In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to solve the problem that the hosts file is invalid after modification". The explanation in this article is simple and clear, and easy to learn and understand. Please follow the ideas of Xiaobian to study and learn "how to solve the problem that the hosts file is invalid after modification".
When we need to block some malicious websites or visit specific URLs and do tests in the intranet, we often need to modify the hosts file, but we will find that sometimes the modification does not take effect, and Windows 7 system and Vista system, XP system will encounter such situations, so study the solution to such problems.
Generally, after modifying the/etc/hosts file under LINUX, it will take effect immediately, even if it does not take effect occasionally, as long as the network service is restarted. Windows, on the other hand, does run into this problem, and it varies slightly between versions of the system.
Before solving the problem, let's take a look at dns and hosts. We know that when visiting a website, we must first resolve the domain name to be accessed into an IP address through the DNS server before we can see the page content of the visited website in the browser. According to Windows system regulations, before making DNS requests, Windows system will first check whether there is a mapping relationship between network domain names in its Hosts file. If so, this IP address mapping is invoked, and if no domain name resolution is proposed to a known DNS server, that is, the request level of Hosts is higher than DNS.
Here's how to modify the Hosts file:
First of all, we need to know the location of the hosts file. In xp,2000, win7 and other systems, find the following location C:\windows\system32\drivers\etc. We can see the hosts file. Note that the hosts file is ascii encoded and has no suffix name.
Second, modify the hosts file correctly. Generally, there will be an example in the hosts file, such as 127.0.0.1 51cto.com That is, on behalf of opening 51cto.com, this URL will be resolved to 127.0.0.1. There must be at least one space between the IP address and the URL. In addition, when writing the mapping in the last line, you must add a carriage return and save it to avoid the last line not taking effect. If a record is temporarily unused, you only need to add a #sign in front of it.
The hosts file has hidden attributes by default, which is invisible by default. The solution is to open My Computer-click Tools-Folder Options-View-uncheck Hide Protected System Files, OK. If you can't save it after modification, please right-click on Hosts file-Properties-Remove read-only attribute to save it.
When modifying the HOSTS file, we often encounter invalid situations after modification. We can use the ipconfig /flushdns command to flush the dns cache, or you can open the service in the administrative tool, find the "DNS Client" to deactivate it and change it to manual mode. Start after modifying the hosts.
Note: When you modify the hosts file while opening the browser, the system will release the part of memory occupied by the hosts file when you close the browser. We will find that it has taken effect when we open the browser again.
If you encounter Windows 7 operating system can not open and edit the situation, usually because of the security mechanism UAC caused, you can press the Shift key, and then right click on the Hosts file, run as an administrator. Or modify the Hosts file permissions, add the current login account to the security tab, and grant write rights.
Another method is to open the properties page of the locally connected Internet (TCP/IP) protocol, click the Advanced button in the General tab, select the WINS tab, check "Enable LMHOSTS query", then press the "Import LMHOSTS" button to import the hosts file, so that when you start the browser again, you will find that the hosts file is valid.
Thank you for reading, the above is the content of "how to solve the problem of invalid hosts file modification", after learning this article, I believe everyone has a deeper understanding of how to solve the problem of invalid hosts file modification, and the specific use needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.