How to Edit Your Hosts File

Sometimes because of prank or an attack, along with many others you can simply and publicly control access to sites and network traffic.

Hosts files are in use since ARPANET. They have been used to resolve hosts titles. Hosts files would be massive documents.

Microsoft kept the hosts record residing in Windows media which is why it changes very little whether used in Windows, macOS, or Linux. Hosts documents are going to have a lot of entrances for loopback. We could use that for the simple example for the normal syntax.

The first part will be the place to redirect the address to, the second part is going to be the address you are going to want to redirect, and the third part is the comment. For ease of reading are generally separated by one or two tabs, although they may be separated by a space.

Now let us look at obtaining the hosts files in the different operating systems…

Windows 8 or 8.1 or 10

Regrettably Windows 8 or 10 makes it bothersome to open apps as secretary — but it is not too difficult. Look for Notepad in the search results list on Notepad, and choose to run it as administrator. That will be on the Start Menu, if you’re using Windows 10.

If you’re using Windows 10, it’ll seem more like this:

tso gridhost


As soon as you’ve done so, open up the next file with the File -> Open feature tso gridhost.


Then you may edit as normal.

Windows 7

To get the hosts file in Windows 7 it is possible to use the following command at the Run Line to open notepad and the file.

Notepad c:\windows\system32\motorists \etc\hosts

After notepad is available you can edit the document. In this case we will block Facebook. To do this just enter from the next after the # mark.

Now you’ve edited your Hosts file make sure to store it.

Now notice if we try to access Facebook in IE we can’t get into the page. Also for more info on editing your Hosts file, have a look at The Geek’s article about how to create a shortcut.


In Ubuntu 10.04 and many Linux distro’s you can edit the hosts file right in the terminal. You can use your favorite editor or open your favourite GUI text editor. For this example we will use VIM. Though here it’s in the source of the driveway, like Windows 7, Ubuntu’s hosts file is located at the / etc / folder. To be able to edit the file you’ll need to open it as root that’s why we use sudo here.

Now it is open we can edit it to redirect Facebook to nothing. You will see that a part is also for IP6. For needs dismiss the IP6 and you will only need to edit it on the section.

Today we can save the document and try to go to Just like in windows we will observe that we are redirected.

In macOS, accessing the hosts file is quite similar to Ubuntu. Begin in terminal and then use your favorite editor, even is you wish to telephone a GUI text editor, it is more easy to do from terminal.

The document will seem somewhat more like Windows, only with a little less explanation. We are going to redirect Facebook.

This time it seems that is a loopback and will direct you to the computers Apache test page.


There are some items to notice from this walkthrough that we did notice. When analyzed it, Chrome did not utilize the hosts file in almost any operating system but we could block Facebook from Chrome by adding Also, be sure that you place and line .

This should get you started in understanding the Hosts file and how it can help protect your PC. You may use it to block sites that you don’t want a PC. If you have more tips for any of those operating systems we then leave a comment coved and let us know!

Related posts