DNS server configuration --- hosts file

hosts file path C: \ Windows \ System32 \ the Drivers \ etc
DNS server configuration --- hosts file
hosts file takes precedence over the DNS server, you can open the hosts file in Notepad, the file has some examples tell us how to add DNS records, such as "127.0.0.1 localhost ", is about to" localhost "the name corresponds to the" on 127.0.0.1 "this IP.
We can add in accordance with the above format in the hosts file records, such as adding a record "202.108.22.5 www name corresponds to the" on 202.108.22.5 "the IP.
Let's do a test. The local connection of the TCP / IP settings the preferred DNS server is deleted, because there is no DNS server to do DNS, so in theory at this time, we will not be able to access any website, but open the IE browser, type in the address bar www.baidu.com found you can still access the Baidu website, which hosts file is in play.
the function of this hosts file is still very strong, in some DNS server could not play a role in the case, we can use it to replace the temporary DNS servers. we can also use it is to mask a malicious Web site, the URL of the malicious Web site corresponds to some wrong or non-existent IP, and that these websites can not access the same file .hosts malicious software can also be utilized, will correspond to some of the normal site's URL to some unscrupulous site IP address, so the hosts file should always check its contents, or Who is with the 360 security guards and other protective software.

Guess you like

Origin blog.51cto.com/13560904/2415530