Skip to content


curl without modifying the hosts file⚓︎

You can provide curl 7.21.3+ custom addresses for any host and port pair, forcing curl requests use a specified address and prevent the otherwise normally resolved address to be used. For each host:port pair you want to override you specify --resolve <host:port:address>, where the ‘*’ wildcard can be used as a host to resolve all DNS to the specified IP.

# perform a curl to and resolve to (CloudFlare)
curl --resolve -k

# perform a curl to any DNS and redirect to (CloudFlare)
curl --resolve *:443: -k