Modifying Your Hosts File

Posted: July 13, 2017 in Uncategorized

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:[tab]
  6. Save changes


  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”
  1. markkruger says:


    Here’s an extra tip:

    Right click on hosts and choose “create shortcut” – Windows will ask to put it on the desktop (won’t allow shortcuts in /etc).

    Find the shortcut and right click and go to properties. It will look like this:

    Edit the “target” by:

    A. Prepending “notepad.exe” to the front of it and B. Putting the original target in quotes – i.e. “C:\Windows\System32\drivers\etc\hosts”

    Should look like this:

    Now you have a short cut that will automatically open Hosts. All you have to do is right click on it and “run as administrator”

    This solves the problem (for me) of first having to open notepad as administrator and then navigating to hosts.

    Hope this helps.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s