Access Website before Dns Propagation with Hosts File

The easiest way to achieve this is by editing your hosts file. The hosts file is a simple list of “hard-wired” domain names and IP addresses that will bypass the normal DNS lookups. In linux systems the hosts file is usually found at /etc/hosts. In Windows systems it varies, but is commonly {windir}\system32\drivers\etc\hosts. This is a regular text file – open it in your favourite text editor and add a new line at the end:

216.180.241.26 example.com

216.180.241.26 www.example.com

ie. Your new account’s IP address and your domain name, separated by one or more spaces. Save and close the file, then restart your browser. Now browse to your web site and you’ll be seeing it on the new server. If the migration has gone well you may not notice any difference – if so you can check your server logs or use a phpinfo file to verify that you’re seeing the right server.

If you are using Windows Vista or Windows 7 to edit the host file,

Click Start – search for “Notepad“, right-click and select “Run as Administrator“. This should launch notepad with elevated privileges. Now, open the host file from the File menu, edit and save.


Note: This way the website is only opening for you, Others will not be able to see the website unless the DNS Propagation occurs completly.

  • 18 Users Found This Useful
Was this answer helpful?

Related Articles

What Is DNS Propagation?

Any time that DNS changes are made (on any level), you need to wait for propagation to complete....

How to Flush the DNS Cache?

Domain Name Server (DNS) names are the IP (Internet Protocol) addresses of the servers that have...

How to test your web site before DNS propagation

The easiest way to achieve this is by editing your hosts file. The hosts file is a simple list of...