Learning to use the hosts file correctly. Key features

Did it happen that the system blocked access not only to suspicious, malicious sites, but also to popular social services (such as, for example, VKontakte or Facebook), official websites of well-known companies, and even to the resources of antivirus software manufacturers? The situation is really not pleasant. And most often the reason is incorrect changes made to the hosts file.

hosts file

What is this file and what is it for?

If you leave aside the complex IT terminology, we can say that the hosts file is a text document that contains information about the IP of various computers. It is thanks to this file that your system transforms the alphabetic name of the site (for example, vk.com) into the numerical combination needed to search for information and display it.

How can I use this file? There are several main tasks for the solution of which it is necessary.

The first is, of course, blocking unwanted sites. Who might need this? Parents who do not want their children to get access to dangerous information or sites marked β€œ18+”. The owners of companies that oppose their employees sitting on social networks during business hours. In order to implement this, you must enter the following line:

hosts file in windows 7

127.0.0.1 adres.sajta (IP address of the computer and address of the unwanted resource). Due to this, the request to the site will remain inside the computer and will not go to DNS, that is, in the browser the user will receive a message about the impossibility of displaying the page.

If there are not tens or hundreds, but thousands and millions of sites that you need to block access to, you can use special free programs from the Internet. For example, you can block once all the sites that the search engine finds for the query "porn".

Another option for using this file is to get quick access to certain pages. How it works? For example, you enter the line in the hosts file

209.85.229.147 g # google.com

Due to this, it will be sufficient to enter only the letter g in the address bar of the browser so that the computer can access IP 209.85.229.147 and open the main page of the search engine.

Incorrect entries in the file can cause the browser to work incorrectly and numerous error messages. What to do if you have made many changes to the file and don’t know which one interferes with the proper functioning of the programs?

To do this, just download or recreate the original hosts file. Only one line needs to be written in it: 127.0.0.1 localhost. For this, a regular notebook is suitable. The finished file must be saved without the .txt extension in the same folder.

original hosts file

Never believe scammers who say that you can restore the hosts file only for a fee, offer to send SMS to suspicious numbers, transfer money to an account (electronic or bank). This is the simplest operation that even an inexperienced PC user can handle.

Where is the hosts file in Windows 7 and other versions of the operating system? Most often, you need to look for it in the Windows system files folder (Windows / System32 / drivers / etc / hosts).

Good luck, and let your hosts always be in perfect order!

Source: https://habr.com/ru/post/C37605/


All Articles