Modify a Computer’s Hosts File

Modifying your hosts file will allow you to access a website on an IP address that is not publicly available in DNS. An example of this is when you are migrating a website from one host to another and want to access the site on the new host’s IP address to verify everything looks proper before you update your DNS and make it live.

You must have administrator privileges to modify your hosts file. Don’t forget to remove the entry when you are done reviewing your website. Entries left on your hosts file will override DNS settings from the computer.

Your hosts file will need one or two entries that contain the IP address that you want the website to resolve to ( used for example purposes) and the website address ( used for example purposes). You may also need to refresh your browser or completely close and reopen your browser for the new entries to take effect. The entries should look something like what is displayed below at the very bottom of the hosts file.

Below are instructions for how to find your hosts file on your computer.

On a Windows Operating System

  1.  Find “notepad” in your Programs > Accessories
  2.  Right click on “notepad” and say “Run as Administrator”
  3. Click “open” in notepad and go to the file located at: c:/windows/system32/drivers/etc
  4. No files will appear since they are hidden so type “hosts” in the “file name” field

On an Mac Operating System

  1. Open the Terminal Application (Applications > Tools > Terminal)
  2. Type “sudo nano /etc/hosts” and click “Return”
  3. Enter your password
  4. This will open the hosts file. From here, you can scroll to the bottom of the file and enter the IP address and website you want to resolve to that IP address.
  5. Exit and Save, press “control” and “x” then you will be prompted to save and click “Y” to save.

If you prefer remote hands from a friendly Valice support professional to assist you, we have membership plans for that. Or if you just want one-time help, click here to schedule a session.