A quick primer (from curl’s most well known maintainer) on requesting websites from servers before you’ve officially changed their DNS entries.
A quick TL;DR; if you’re conserving mouse clicks
For non-SSL/HTTPS sites it’s as simple as changing the
HOST header —
curl --header "Host: example.com" http://127.0.0.1/
If you’re using SSL/HTTPS, things are a bit more complicated. In for this case you’ll want to use the
curl --resolve example.com:443:127.0.0.1 https://example.com/
Here you’ll make the request to the actual URL, and
resolve tells curl which IP address to use. There’s more context in the article about why this is necessary.