Let me begin by explaining what a Hosts File is. A hosts file is a file that every computer on every operating system has. It connects an IP address with the corresponding name. All devices connected to the Internet have an IP address. The corresponding name of that IP address is used by people because it is easier to remember than a string of numbers. It is easier to remember facebook.com than 69.63.176.0 which is one of many IPs that Facebook uses.
For communication purposes the devices connected on a network don't need names, they need IP addresses. Before the hosts' file was invented computer programmers used to write down the IP addresses of computers they need to connect to on a piece of paper that always needed to be in plain sight. They needed a physical copy to associate each IP address to a computer. Depending on how many devices they needed to connect to this list of IP addresses could, in theory, have been several pages long. The hosts' file was introduced to create a centralized database of all IP addresses and computer names that could be shared with anyone on the network. The physical copy that I mentioned above became obsolete after the creation of a host's file.
The file can be easily edited using a text editor like Notepad. It consists of an IP address and the corresponding domain name. Since I used Facebook as an example before, a host's line entry for Facebook would look like this:
69.63.176.0 facebook.com
Where is the Hosts File Located?
On Windows systems you can find the hosts file in the following location:
C:\Windows\System32\Drivers\etc\
This is usually a hidden file so if you can't find it there you need to tick the option to enable hidden files on your computer. You can refer to this article for more information on how to do that.
You might also need to open the file as an administrator to be able to edit and save it. A detailed guide on how to do that is available here.
On a Mac device, you need to navigate to "/private/etc/" to be able to edit the host's file.
On Linux, you need to open a terminal and type "sudo nano /etc/hosts"
Credits go to o_e_l_e_o for providing the Mac and Linux locations.
What is the Purpose of the Hosts File?
The average computer user doesn't need to know too much about what hosts files do exactly and when they are used but they can still be very useful to them. They are particularly useful in restricting access to unwanted websites. Any website that spreads adware, malware, phishing links or spyware can be prevented from loading on a particular computer by editing its host's file.
Here is an example of what I mean. A lot of malware and spyware are spread through social media. Social media is also a place for advertising unwanted content such as gambling, fake news, and pornography. As a parent, you want to protect your children from being exposed to such content but also prevent your local network from accessing it. This is where an adequately edited host file can help and you don't even have to be a computer geek to do it yourself.
Thankfully, people like Steven Black have been posting different versions of host files on GitHub that everyone can download or just copy and paste the parts they want. On his GitHub repository, the author has made over 43.000 entries. Each line represents one website with unwanted content.
The repository is regularly updated, with the most recent adjustments being added on November 3. There are 15 different host file variants to choose from with the blocked sites categorized according to their content. Users can block access to unwanted porn, gambling and/or social media content. The creator added that the files should work on all devices and all operating systems.
Steven Black Hosts GitHub Repository
Sources:
https://www.youtube.com/watch
https://www.zdnet.com/article/how-to-use-a-hosts-file-to-improve-your-internet-experience/
https://github.com/StevenBlack/hosts
Congratulations @bernardos! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!