Locally bound domain name and host for fast resolution and domain name shielding

After successfully installing IIS on the computer, open C:\WINDOWS\system32\drivers\etc\
to open the hosts file with Notepad, copy and paste 127.0.0.1 localhost to the end, and then change localhost to the domain name to be bound,
In this way, directly entering your own domain name in the IE browser has the same effect as entering 127.0.0.1, and you can also open the installed program.

Binding is not the only solution point to advanced delete the default logo!

There are two methods for domain name resolution: DNS and host table. The host table is stored as a text file in the \windows folder of Windows9x or the \Winnt\system32\drivers\etc folder of WindowsNT. The format of the Hosts file is very simple, that is, one record of the IP address corresponding to the domain name. An example is as follows:


127.0.0.1 localhost # localhost 
192.168.0.1 proxyserver # proxy server 
192.168.0.100 www.mydom.net # intranet WWW server


The file should be kept updated frequently, with frequently used domain names at the front of the file

 

What is the domain name resolution file Hosts? What does it do?

1. Speed ​​up domain name resolution. 

For websites that we want to visit frequently, we can configure the mapping relationship between domain names and IPs in Hosts, so that when we enter the domain name, the computer can quickly resolve the IP without requesting DNS on the network. server. 

2. Convenience for LAN users 

In the LANs of many units, there will be servers available for users to use. However, since DNS servers are rarely set up in the local area network, it is quite troublesome for many people to enter difficult-to-remember IP addresses to access these services. Now you can give these servers an easy-to-remember name, and then set up IP mapping in Hosts, so that we can enter the name of this server when we visit later. 

3. Block websites 

There are many websites that install various plug-ins into your computer without the user's consent, some of which may be Trojan horses or viruses. For these websites, we can use Hosts to map the domain name of the website to the wrong IP or the IP of our own computer, so that we don't have to visit. For example, if you don't want to visit www.XXXX.com, then we write the following content in Hosts: 

127.0.0.1 www.XXXX.com #blocked website 
0.0.0.0 www.XXXX.com #blocked website 

so that the computer can resolve the domain name and resolve to this machine or wrong IP to achieve the purpose of shielding. 

4. Smooth connection to 

the system For Lotus servers and some database servers, if you directly enter the IP address during access, it cannot be accessed, and only the server name can be accessed. Then we configure the Hosts file so that we can connect successfully by entering the server name. 

Finally, it should be pointed out that the mapping configured in the Hosts file is static. If the computer on the network changes, please update the IP address in time, otherwise it will not be accessible.

5. Force a domain name to correspond to an IP address

 

localhosts文件可以做很多事情, 如你不想在本机网页上出现百度这种网站,可以做屏蔽效果,并指向你想要访问的网站   格式就是 IP 空格 域名

这里是我的测试云服, 附上一张图,

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326330310&siteId=291194637