WhoDNS
All articles
Language: FA

Previewing a Site Before DNS Cutover: The Host Header Trick

Moving a site to a new host always carries the same puzzle: you want to verify the site works on the new server, but switching the DNS record makes the change live for every visitor immediately — and if something is wrong, you are now debugging in production. The escape from that dilemma is called skip-DNS: connect to the new server directly, while pretending the DNS switch already happened.

How the Host header makes it work

Web servers host many sites on one IP and decide which one to serve based on the Host header in the request. So you send your request to the new server’s IP, but you write the real domain name in the Host header. The server cannot tell the difference from a request that arrived "after" the DNS switch — it serves exactly the site that will go live. The same trick from a terminal looks like this:

curl -H "Host: example.com" https://203.0.113.77/ -k
# or let curl map the name for you:
curl --resolve example.com:443:203.0.113.77 https://example.com/

The WhoDNS skip-DNS tool does exactly this from our infrastructure: you give it the destination IP and the domain, and it fetches the site from that server while presenting the correct Host header — the site as it will be, served by the machine that is not published yet.

What to check before cutover

  • The homepage loads without an unexpected redirect — a redirect loop between old and new server rules is the most common migration bug.
  • The SSL certificate is valid on the new host. If the certificate was not installed or the chain is incomplete, browsers will reject the site the moment DNS goes live.
  • Internal links, stylesheets and fonts resolve correctly. Hard-coded absolute URLs pointing at the old server produce mixed-content warnings or silently load half the page from the old host.
  • Admin panels and forms work, since POST handling and PHP versions can differ between hosts.

Limits of the trick

  • Server-side caching: CDNs and object caches key their content by hostname, so a cache on the new server may serve stale pages even though the origin is correct. Purge caches before judging the result.
  • Cookies are set for the domain, not the IP: if your preview needs a login, session cookies may not behave until DNS is live. Testing logged-in flows through the IP does not always reproduce the real experience.
  • Not every feature can be tested: callbacks and webhooks that third parties send back to your domain still follow public DNS and will land on the old server until cutover.

Once everything checks out, lower the DNS TTL well in advance (300 seconds or less), switch the record, and watch propagation from several regions. Skip-DNS turns a risky cutover into a formality: by the time you touch DNS, the answer is already verified — you are just publishing a result you have seen work.

🔗 Related tool: Preview a site on a new server without DNS changes

skip DNSsite previewHost headerhosting migrationcurl resolve