Plainnotes

Testing a new host before DNS moves with --resolve

2024-04-18 · 2 min readTools

A new host is configured but DNS has not moved. You want to verify it without editing /etc/hosts or waiting.

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

--resolve applies only to that request, in the form host:port:address.

For HTTPS, certificate validation uses the name, not the address, so this also checks the certificate — exactly what needs confirming before the switch.

openssl works the same way:

openssl s_client -connect 203.0.113.7:443 -servername example.com

Always pass -servername; without it you get the default certificate and learn nothing.