Map a hostname and port to a specific IP address.

Section: Debugging and Diagnostics

Override DNS resolution

bash
bash
curl --resolve example.com:443:127.0.0.1 https://example.com
Explanation

Great for testing a site before DNS changes propagate.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Debugging and Diagnostics
Redirect one host:port to another
Change where curl connects without changing the URL's host name.
OpenIn sheetbashsame section
Limit connect time
Fail if the connection cannot be established quickly.
OpenIn sheetbashsame section
Limit total transfer time
Abort the request after a fixed total duration.
OpenIn sheetbashsame section
Use an HTTP proxy
Send requests through an HTTP proxy.
OpenIn sheetbashsame section
Use a SOCKS5 proxy
Route a request through a SOCKS5 proxy.
OpenIn sheetbashsame section
Force HTTP/2
Ask curl to use HTTP/2 where supported.
OpenIn sheetbashsame section