One of the biggest problems with moving your server to a new hosting company is when you move the DNS entries, it can take 12-24 hours before your DNS is fully transferred. During that time, it might not be possible to check if your website has been moved over to the new server correctly. Here, I show you how to point your computer’s DNS to your new server IP address in Windows so you can load your website on the new server while DNS is still being delegated throughout the interwebs.
P.S. Mac or linux should be similar, just google “Mac hosts file” or “Linux hosts file”.
When you change your DNS records, your DNS delegation will usually take more than 12-24 hours on average. This means that during that time, it might be impossible to check your website.
This can be a big problem if you are moving a website to a new server and you can’t check if you’ve moved everything right.
So, how do you check your website on the new server during DNS delegation?
You can easily do this by changing the DNS servers on your computer.
For Windows, you can go into your network adaptor settings, then right-click on your adaptor, then select “Properties”.
You will see a bunch of options like the above screen shot. Simply double-click on “Internet Protocol Version 4 (TCP/IPv4). This screenshot was from Windows 7 and on other Windows, I think it’s simply called “TCP/IP”.
Here, you can set your DNS server to your new web server’s IP address. In this example, I set it to “22.214.171.124”.
Click okay and try navigating to your URL such as mydomain.com. Now you should be able to see your website on your browser and make sure your website has been moved successfully before DNS delegation is finished.
Also, any images not from your own domain name (URL) will not load on your browser. This is because you can only load elements from your domain name as your DNS is set to your new web server.
Now, this might not work if you are on shared server or it could, it depends on your hosting provider. For dedicated servers, VPS, or hosting servers with your own unique IP address, it should work flawlessly.
Make sure you go through the above process and set your DNS back to “Obtain DNS server address automatically” when you are done testing your new server.
That is one of the ways of doin’ it but there’s also a better way if you want to be able to access the whole internet.
You can edit the hosts file under C:\windows\system32\drivers\etc\hosts. Simply edit the file with a notepad program and add the following line at the end of the file:
where 126.96.36.199 is the IP of your new server and mydomain.com is the domain name of your website.
Now save the file and try loading your site on the browser, it will load from your new server.
One more thing, you can also check the IP address of your website (to make sure it’s coming from the new server) by going to command prompt (type cmd under Start->Search programs and files) then typing ping mydomain.com.
By being able to check that everything is working correctly on your new server, you will lose ZERO traffic during DNS delegation because your website will load flawlessly whether on the old server or the new server.
How cool is that?
Well, for those of you who didn’t know, now you know! Make sure to subscribe for more great free tips on hacking your web server!