Thursday, March 26, 2026

curl dns override

Back in the day it was possible to connect to a specific site on a specific ip, just by supplying the host header.

curl -v -H "Host: www.example.com" https://127.8.4.2

But with tls1.3 strict SNI checking, the host header isn’t enough.
It is, however, possible to override dns by using the –resolve override.

curl -v --resolve www.example.com:80:127.8.4.2 https://www.example.com