Tip on Editing the Hosts file as an Administrator

March 1, 2017

hosts file imageDuring the process of moving a site from one hosting company to another, it is a good idea to test the site on the new host.  You can do this by modifying your computer’s hosts file (you should use local administrator/root user to be able to save changes). You may test your site using your computer’s local hosts file by adding a line at the end of the file that has the ip address and domain names.

The hosts file allows you to set IP addresses for a domain on your local computer that may override the authoritative DNS. This will allow you to see what a domain will display if it is pointed to a different server.

You may find your computer’s local hosts file at the following location, depending on your operating system:

Unix, Android, iOS 2.0 and newer: /etc/hosts Mac OS X 10.2 and newer: /etc/hosts Windows XP and newer: Windows\system32\drivers\etc\hosts

If you are getting an error message that you need to be the administrator (even if you are signed in as the administrator) to save the changes, go to your windows icon and search bar and type in “Notepad”.  Before launching Notepad, right click on the icon and choose “Run As Administrator”.  This will now allow you to save changes and test out your site!

Copy link
Powered by Social Snap