The role of the host row in the HTTP request header
In earlier versions of HTTP version 1.0, the request header for HTTP was not with the host row, and the host row was added to the enhanced version of HTTP 1.0 and HTTP 1.1.
The role of the host row in the HTTP request header:
Such as:
get/http/1.1
Host:www.google.com.hk
...
One IP address can correspond to multiple domain names: one virtual host (server) has only one IP, which can put thousands of websites. When a request for these sites arrives, the server determines which specific Web site this request is based on the value in the host row.
The relationship between IP address and domain name
IP address such as 202.108.22.5 is equivalent to the real life of the communication address, in the network of all the essence of communication is actually all the address to achieve the purpose.
But this IP address is made up of numbers, inconvenient for people to remember, so define the domain name to solve the trouble of IP address, such as access to Baidu just type www.baidu.com on the line, without laborious to write 202.108.22.5
But the computer does not know that www.baidu.com is equal to 202.108.22.5, there is a correspondence between them. The corresponding data of this IP address and domain name is placed in the server of the public network, called the DNS server. Computer access to the network, will first go to this server, according to the domain name to find the corresponding IP address, and then really go to the destination, but the process is very fast, it is not felt at all. This process, called IP address resolution.
DNS server: Responsible for resolving the domain name to be the IP address of the server, called the domain name resolution server, English abbreviation is DNS.
HTTP Header Host