Modifying your hosts file enables you to override the DNS for a domain, on that particular machine. This is useful when you want to test your site prior to going live and for other DNS-related reasons. Modifying your hosts file causes your local machine to look directly at the IP address specified. After your site goes live, you should remove this DNS override.

To modify the hosts file, you add a line to the file that contains the IP address that you want the site to resolve to and the address. In this example we are going to forward to the Fastnet1 web server:

After you add the domain information and save the file, your system begins resolving to the specified IP address. After testing is finished, remove these entries.

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

  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:
    Insert this line at the top of the hosts file, substituting with your domain
  6. Click File > Save to save your changes.
Skip to content