How To Preview Your Website After Migration ; Before Switching DNS ?

Find the IP address of the new server you are moving your site to. Then on your personal computer open “hosts” file using your favorite editor , At the end of the file, you can put the IP of the new server and then the domain you have migrated. Save the file.

For Linux

# vi /etc/hosts 

192.168.0.1 domain.com

If your personal machine is Windows or Mac , Please do like this:

For Windows

On the Notepad screen, go to File > Open and then go to C:\Windows\System32\drivers\etc. Select hosts file and open it. Add entries like this :

192.168.0.1 domain.com

For Mac

Open the Terminal app and enter this command to edit hosts file:

sudo nano /private/etc/hosts

192.168.0.1 domain.com

Replace the IP address 192.168.0.1 with your new server IP , and “domain.com” with your own domain name. Now in your browser, go to the domain that you are wanting to preview. It will now appear how it would once you actually change the DNS with your domain registrar.

Important: Don’t forget to undo the changes you made to hosts file after you have finished the migration