This article from network: http://blog.163.com/kmpaswxq_6651888/blog/static/18032394201132415322540/
During website development, you need to browse the editing effect on the local computer. You need to open a host in the local IIS. Generally, we use the default port 80 of IIS, enter "localhost" or "127.0.0.1" in the browser to access the service. However, different ports, such as 81 and 82, need to be used to open multiple hosts, after this, it will be a bit messy, sometimes dueProgramThe port cannot be identified, causing some errors. Can we customize the test domain name locally? For example, to create a mall, bind a Host Header: shop.test.com in IIS to make a friend website, bind a Host Header: friend.test.com in IIS, and then in the test, enter shop.test.com or friend.test.com in the browser. The answer is yes. The specific method is as follows:
Open the file c: \ windows \ system32 \ drivers \ etc \ hosts, and add the following at the end of the file:
127.0.0.1 shop.test.com
127.0.0.1 friend.test.com
After saving the file, you can bind it to IIS. With this method, it is much easier to develop portal websites with sub-station systems, you can directly add the official domain name and its Substation domain name to this file, so that the local test and Internet test results are the same.
It must be noted that the domain name of this method must be added one by one and does not support wildcard domain names. If you want to use wildcard domain names, you can use bind, it is an open-source cross-platform DNS server software. You need to install and configure the file (under c: \ windows \ system32 \ DNS \ etc). For details, refer to Baidu.