Modifying your hosts file enables you to override DNS for a domain on your local machine, and is useful if you are testing your site before DNS has been updated to your new Touchstone IP address.

You must modify your hosts file if you are a Touchstone customer with a WAF ("Web Application Firewall") deployment. All Touchstone Level 3 and high accounts are implemented using WAF. An upgrade is available to Level 2 accounts.

WAF is particularly important if your site is suffering from DDoS attacks or repeated login attempts from unknown locations.

To modify the hosts file, you add two entries to the file that contains the IP address that you want the site to resolve to and the address. Adding the following two lines, for example, direct your computer to connect to the IP address listed on that line.

127.0.0.1 www.domain.com
127.0.0.1 domain.com

Windows

Windows 10, Windows 8, Windows 7, and Windows Vista use User Account Control (UAC), so Notepad must be run as Administrator.

NOTE: We have some reports that the file/directories are not visible when using Notepad to search for the file. If this is your situation, try copying/pasting the filename below directly into Notepad. You may also be required to stop/suspend anti-virus software you have installed in order to be able to edit/save the hosts file.

For Windows 10 and 8

  1. Press the Windows key.
  2. Type Notepad in the search field.
  3. In the search results, right-click Notepad and select Run as administrator.
  4. From Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts
  5. Make the necessary changes to the file.
  6. Click File > Save to save your changes.

For Windows 7 and Vista

  1. Click Start > All Programs > Accessories.
  2. Right-click Notepad and select Run as administrator.
  3. Click Continue on the Windows needs your permission UAC window.
  4. When Notepad opens, click File > Open.
  5. In the File name field, type C:\Windows\System32\Drivers\etc\hosts.
  6. Click Open.
  7. Make the necessary changes to the file.
  8. Click File > Save to save your changes.

Windows NT, Windows 2000, and Windows XP

  1. Click Start > All Programs > Accessories > Notepad.
  2. Click File > Open.
  3. In the File name field, type C:\Windows\System32\Drivers\etc\hosts.
  4. Click Open.
  5. Make the necessary changes to the file.
  6. Click File > Save to save your changes.

Mac OS X 10.6 through 10.12

  1. Open Applications > Utilities > Terminal.
  2. Open the hosts file by typing the following line in the terminal window:
    sudo nano /private/etc/hosts 
  3. Type your computer account password when prompted.
  4. Edit the hosts file. The file contains some comments (lines starting with the # symbol), and some default hostname mappings (for example, 127.0.0.1 – local host). Add your new mappings after the default mappings.
  5. Save the hosts file by pressing Control+x and answering y to "save modified buffer". You will then need to press Enter to save the file.
  6. Make your changes take effect by flushing the DNS cache with the following command:
    dscacheutil -flushcache 

The new mappings should now take effect.

Did this answer your question?