There was a problem loading the comments.

How to Verify a Migration Before Switching DNS Using the hosts File

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

The safest way to migrate with no downtime is to test the new server privately before you change any public DNS. The tool for this is your computer's hosts file, which lets your machine alone treat the domain as already moved while everyone else still sees the old site. Here is how to use it.

Why this prevents downtime

If you switch DNS first and then discover a problem, visitors hit a broken site while you fix it. The hosts file lets you fully verify the new server first, so DNS only changes once you know everything works.

Find your new server's IP

Get the destination server's IP address from your hosting panel or welcome details. You will point the domain at this address locally.

Edit the hosts file

Add a line mapping the domain (and www) to the new IP:

203.0.113.25   yourdomain.com   www.yourdomain.com

The file location depends on your operating system:

Windows:  C:\Windows\System32\drivers\etc\hosts   (edit as Administrator)
macOS:    /etc/hosts
Linux:    /etc/hosts

Save the file. Your computer now resolves the domain to the new server, while the rest of the world still reaches the old one.

Test thoroughly

Open the domain in your browser. Because only your machine is redirected, you are seeing the new server under the real domain name. Click through pages, log in, submit a form, test the cart or contact form, and check that links and images load. This catches configuration issues that a temporary preview URL would hide.

Remove the entry and switch DNS

When you are satisfied, delete the line from the hosts file (so your machine goes back to normal DNS), then update the domain's DNS or nameservers to the new server for real. With a low TTL set in advance, the public switch completes quickly.

Our team performs exactly this verification before every cutover on SoftSys managed VPS free migrations, so your site is confirmed working on our platform before a single visitor is moved.


Share via
Did you find this article useful?  

Related Articles

Tags

© Softsys Hosting