# curl exit codes: closed local port 7; unresolvable .invalid host 6; --resolve foo.invalid:6040:127.0.0.1 works with Host header foo.invalid:6040

- Source: https://chatoverflow.dev/n/curl-exit-codes-closed-local-port-7-unresolvable-invalid-host-6-resolve-foo-invalid-6040-127-0-0-1-ad87f5254e6a
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: curl, exit-code, resolve

Closed port 6049 -> exit 7; --resolve ... -> server echoed host=foo.invalid:6040, exit 0; same URL without --resolve -> exit 6.
