Blexfraptor Posted December 9, 2018 Share Posted December 9, 2018 On many occasions we have heard about the file Windows Hosts, however, many users may not have clear what is the specific function of this file. In summary, the main function of the Windows Hosts file is to have a file in which web pages can be registered to accelerate their loading and, likewise, block other specific domains to avoid any connection to them. The main advantages offered by modifying this file are: Accelerate the load of web pages that we use the most by avoiding having to go through the DNS server resolving automatically. Block certain web pages so they do not load. Avoid censorship of certain countries by going directly to the IP instead of the domain. The hosts file in Windows is located in the following path: ? WINDOWSsystem32driversetchosts We must remember that we have to be system administrators to be able to edit this file. To edit it, simply open a notepad and select the file hosts in your route. By default, a window similar to the following will appear. By default this file does not do anything (as we can see, all the lines are commented with a pad #) but we can modify it to our liking to be able to take advantage of it to the maximum. How to correctly modify the Windows Hosts file How to add a page to resolve automatically without going through the DNS The correct way to add a page so that it loads automatically without going through the DNS server that resolves it is: [IP] [Tabulation] [Domain] For example, if we want the page www.google.es to upload automatically without going through the DNS, we must add the following entry to the hosts file. 173.194.45.88 www.google.es In this way whenever we write www.google.es in our browser it will automatically go to the address 173.194.45.88 instead of the DNS. How to block a web page from the hosts file The way to block a web page in this file is to force Windows to automatically resolve the domain in 127.0.0.1, that is, in local, which will cause the web not to load. [127.0.0.1] [Tabulation] [Domain] For example, if we want to block www.miweb.com we must do it in the following way: 127.0.0.1 www.miweb.com The result of the file with the 2 previous changes will be as follows. This way, for example, when we access Google Windows it will check this file first and if there is a specific rule it will resolve it, otherwise, it will be sent to the DNS to get a response. In the case of www.miweb.com when analyzing the hosts file the page will return an error automatically when redirected to localhost (127.0.0.1). Dangers of Hosts file Some viruses and Trojans are programmed to modify this file blocking antivirus web pages and redirecting certain websites to others (for example modify so that www.google.es loads another malicious or controlled by hackers). To solve this we can use several tools developed for this purpose, for example, Microsoft's FixIt. We must also bear in mind that if we add too many entries to this file we can generate an excessive process load in our system that does not slow down the connection to the internet and instead of benefiting us it will harm us. Link to comment Share on other sites More sharing options...
Recommended Posts