BlogUncategorized

Preview a Migrated Website Before Changing Public DNS

Filed under

You can preview a migrated website on your own computer before changing public DNS by temporarily mapping its hostname to the destination IP in your local hosts file. Other visitors continue to use public DNS. This tests your browser's path to the replacement website; it does not test every external integration or guarantee a downtime-free migration.

Prepare the destination and keep a recovery copy

Confirm the destination IP and that the server is configured for your actual domain. Back up your hosts file before editing it, and preserve unrelated entries. On a managed work computer, follow your administrator's access policy.

The usual Windows location is C:\Windows\System32\drivers\etc\hosts, or the corresponding directory beneath %WinDir%. Microsoft's hosts-file documentation describes the path, plain-text format and permissions. On Linux and macOS, use /etc/hosts; macOS also exposes it through /private/etc/hosts.

Add only the hostnames you need to preview

Using an editor with the necessary permissions, add the destination address followed by the hostname. This example uses a documentation-only IP: replace it and both domains with your confirmed values.

192.0.2.10 example.com
192.0.2.10 www.example.com

Save as the original plain-text hosts file, without adding a .txt extension. cPanel documents this local preview approach. An override for one hostname does not automatically cover every subdomain.

Confirm which server answered

Visit the normal hostname, including HTTPS where used. Check a harmless destination-only marker or the destination access log to establish which environment answered. If the old site appears, investigate cached resolution, proxy or VPN behavior and the exact hostname before assuming the migration failed.

Do not bypass certificate warnings to declare the preview successful. Validate the destination certificate and hostname configuration. Check the application operations that matter, while preventing test orders, messages or scheduled tasks from affecting real users. External callbacks and other computers still use their own resolution path.

Remove the override when finished

Delete only the temporary entries you added, save the file and verify normal access again. Keep your results for the migration decision. A successful local preview supports the wider migration checks; synchronization, traffic switching and rollback remain separate work.

This substantive revision was prepared with AI assistance using the cited sources and current service information. See our editorial policy.

Published

Uncategorized