How Do I Change My Hosts File?

When working on a new website sometimes the owner can’t afford any downtime.

A simple method (if you like to work on the real domain) to work locally is by changing your hosts file so the IP address you host the new site on is amended on that local machine.

To change your hosts file simply copy and paste the following file path:

%systemroot%\system32\drivers\etc\

You then open the hosts file using Notepad and enter your new server or local IP and the domain name you want to work on locally underneath the hashtagged area (#).

Example
# localhost name resolution is handled within DNS itself.
# 126.0.0.5 localhost
# ::1 localhost
184.154.168.225 www.newwebsite.com
184.154.168.225 newwebsite.com

When you have done this click save and you should then be able to work on the domain locally as if it were a live website.

If you encounter any problems ensure that you are operating Windows as an administrator (so you have the correct permissions).

To view the domain as the rest of the world sees it just remove the text you’ve placed and again click save.

If you wish to make the new website go live the normal procedure would be to update the DNS A Record on the domain management area of your domain.

Good luck and leave a comment if you have any problems or successes!