About this article
This article was created using an automated generation workflow powered by generative AI. Based on the official curl documentation, we organized--resolveas a safe verification procedure to temporarily override only the destination IP for a specific hostname without changing DNS settings.
Verification status: 📘 Confirmed with official curl specifications – actual communication not verified
When verifying before switching a web server, you can use curl --resolve to specify the connection destination for only that single curl execution, without needing to change the hosts file or DNS for the entire PC.
First, let's look at how it works
curl -I --resolve example.com:443:93.184.216.34 https://example.com/
--resolve passes the mapping for host:port:address to curl. What we check here are the HTTP response and the presence of any TLS errors.
*The IP address above is for illustrative purposes only. In actual testing, use the verification IP provided officially by the target service or one that you manage. Avoid experiments that point unrelated hostnames to third-party servers.
Try changing one location
Keeping the same URL, change only the address to the IP of the server under test. This allows you to verify whether the new server responds as expected before making the DNS public.
Why it is easier to isolate issues than modifying the hosts file
Modifying the OS hosts file affects other browsers and applications as well.--resolve applies only to that specific curl execution, keeping the test scope narrow. There is also no risk of forgetting to revert the hosts file afterward.
When TLS fails
With HTTPS, certificate hostname verification is also performed.-k / --insecure If you carelessly bypass this with , you might overlook the certificate verification required in production. First, check the certificate, SNI, and virtual host configuration.
When using it for work
It is useful for pre-checks during web migrations, load balancer switches, CDN changes, and new Nginx backend rollouts. It is ideal for troubleshooting scenarios such as wanting to access a new IP via HTTPS with a Host header while DNS still points to the old system.
