Modifying Your Hosts File

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. In Notepad, open the following file: “c:\Windows\System32\Drivers\etc\hosts”
  5. Append your entry such as:
    127.0.0.1[tab]www.mysite.com
  6. Save changes

Linux

  1. Open the “/etc/hosts” file in a text editor such as vi or nano
  2. Make the necessary changes to the file.
  3. Save 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 domain user password when prompted.
  4. Edit the hosts file.
  5. Save the hosts file by pressing Control+x and answering y.
  6. Make your changes take effect by flushing the DNS cache with the following command:
    “dscacheutil -flushcache”
Advertisements