What is the purpose of Hosts files
Today, I will talk to you about the role of Hosts files. Many people may not know much about them. In order to let you know more, Xiaobian summarized the following contents for you. I hope you can gain something according to this article.
The Hosts file specifies the correspondence between domain names and IP addresses. If a domain name specifies an IP address in the hosts file, the system will not resolve its IP address through DNS (Domain Name System) when accessing this domain name, but directly access the specified IP address. That is, with the help of the hosts file, we can bypass DNS servers and access some domain names directly.
For Windows, for example, Hosts file format is " ", such as:
127.0.0.1 google.com #Redirect google.com to 127.0.0.1
Here is the location of the hosts file in common operating systems:
1. Windows: %SystemRoot%\system32\drivers\etc\, such as C:\Windows\System32\drivers\etc\
2. Macintosh and iOS: /etc/hosts
Symbian: C:\system\data\hosts (Symbian OS 6.1 - 9.0) and C:\private\10000882\hosts (Symbian OS 9.1+)
4.Android:/system/etc/hosts
Hosts files can be used for surveillance, such as blocking certain websites by setting their IP addresses to non-existent addresses, or domain hijacking, where some virus programs modify the hosts file to redirect a domain name to a malicious website.
hosts folder:
Windows system hosts are located at C:\Windows\System32\drivers\etc\hosts
Android hosts is located in/system/etc/hosts
Mac hosts are located in/etc/hosts just like Linux.
iPhone (iOS) system hosts are located in/etc/hosts just like Linux Mac
Linux hosts are located in/etc/hosts
You can also use Notepad++ to convert text encoding and newline formatting on your own. Of course, Old D shared everything.
How to change hosts:
Windows
Start-> Run-> Enter cmd -> In CMD window enter
The code is as follows:
ipconfig /flushdns
Linux
terminal input
The code is as follows:
sudo rcnscd restart
For systemd distributions, use the command
The code is as follows:
sudo systemctl restart NetworkManager
If you don't understand, please try.
Mac OS X Terminal Input
The code is as follows:
sudo killall -HUP mDNSResponder
After reading the above, do you have any further understanding of what the Hosts file does? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.