If you have had a website for quite some time now and moved service providers or servers or installed SSL there are chances you might have seen a 404 error or a page saying your website’s IP address has changed. The most common reason you encounter this error is when the DNS propagation is not complete. What this means is as simple as your domain name is not translating to the correct IP on which the website works at the moment. To view your website you will have to wait for a couple of hours to a maximum of 72 hours. However, in this post I will walk you through using a file named “hosts” in your PC to bypass DNS propagation wait time. You can also use this method to view a live site on a staging/development server.
In our example, let us say our domain name is google.com and the IP is 98.138.253.109 (I’m using one of Yahoo’s IP that is working at the time of writing this blog).
1) Open your note page as an administrator:
2) Open hosts file:
Hosts file is usually found under C:WindowsSystem32driversetc.
3) Add the entries:
Add the IP first and then the domain name. If you have additional domain name, enter them on the next line.
4) You are done!
That is all you had to do. Now go to your browser, clear cache and open google.com and your will be surprised to see the page (shown below).
Please note that this applies to every Operating System. However the path and the name of the hosts file might vary. The procedure and tools to edit the file may vary. I hope you will find this useful.