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

Category: Web Servers & Proxies

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

Test a vhost locally before DNS points to it

--resolve overrides DNS for this request only, connecting to 127.0.0.1 while still sending the Host header and SNI (server name indication) for example.com. Perfect for testing a new virtual host before changing DNS. Repeat for each domain a server hosts.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.