Getting started-learn about the basic principles of DNS

Source: Internet
Author: User
Tags aliases

We know that the host name can be used to identify a host or an IP address. People prefer to use host name identifiers that are easy to remember, while vrouters only wish to use IP addresses with fixed lengths and hierarchies.

We can identify a person in multiple ways. For example, the name on the birth certificate can also be indicated by a social security number or a driver's license number. Although these identifiers can be used to identify people, there is a more appropriate identifier in a background than other identifiers. For example, computers in IRS (a tax agency in the United States) prefer to use a fixed length of Social Security numbers rather than names on birth certificates. On the other hand, in daily life, people prefer to use the name on the birth certificate rather than the social security number (indeed, you can imagine that if a person says "Hi, my name is 132-67-9875. Please refer to my husband, 178-87-1146 ).

Hosts on the Internet can be identified by multiple forces just like humans. One of the identification methods is to use the host name (hostname ). Host names (such as cnn.com and www.yahoo.com) are helpful for memory usage. However, the host name provides almost no information about the location of the host on the Internet (the host with the Host Name sina.com.cn may be in China, and there is no other location information ). In addition, the host name is composed of variable-length letters and numbers, which makes it difficult for the router to process.

Therefore, hosts on the Internet also use the so-called IP address ID. We will discuss IP addresses in depth in the future. Here we will briefly describe them. The IP address consists of 4 bytes and has a strict hierarchy. IP addresses are generally expressed in dotted-decimal format. That is to say, all four bytes are expressed in decimal numbers ranging from 0 to 25. Each byte is separated by a dot, for example, 121.7.106.83. The IP address has a hierarchical structure. When scanning an address from left to right, we get increasingly clear information about the location of the host on the Internet. This is like scanning a postal address from bottom to top, and we get increasingly clear information about the location of the house.

Services provided by DNS

We already know that you can use the host name to identify a master sail or an IP address. People prefer to use host name identifiers that are easy to remember, while vrouters only wish to use IP addresses with fixed length and hierarchical structure. To mediate these two different preferences, we need a directory service that converts the host name to an IP address. This is the main task of the Domain Name System (DNS) of the Internet. DNS is a distributed database that consists of named server hosts and an application layer protocol that allows the customer host to communicate with the name server host to use the Domain Name Translation Service. The Name server host is usually a UNIX host that runs the Berkeley Internet Name Domain (BIND) software. The DNS protocol runs on UDP and uses the port number 53.

Other application layer protocols (such as HTTP, SMTP, and FTP) generally use DNS to convert user-provided host names to IP addresses. For example, we consider what happens when a user requests a http://www.yesky.com using a browser (that is, an HTTP client) running on a local host. To send an HTTP request message to a web server host named www.yesky.com, the browser must be informed of the IP address of this host. We know that almost every host runs a DNS application client. The browser extracts the host name from the URL and passes it to the DNS application client on the local host. The DNS client sends a DNS query message containing the host name to a DNS server. The DNS Client finally receives a response message containing the IP address corresponding to the host name. The browser then opens a TCP connection to the HTTP server located in the IP address. From this example, we can see that DNS introduces extra latency (sometimes quite large) to Internet applications that use it ). Fortunately, as we will discuss soon. the expected host name-IP address ing relationship is often cached in the nearest DNS name server host, which helps reduce DNS access latency and DNS network traffic.

In addition to the conversion from the host name to the IP address, DNS also provides some important services:

◆ Host alias (hody aliasing ). A host with a complex host name can also have one or more aliases. For example,

The host whose host name is the relay1.west-coast.enterprise.com has two aliases: enterprise.com and www.enterprise.com. In this case, the host name relay1.west-coast.enterprise.com is called the regular host name (canonical hostname), and the other two host names are the alias Host Name (alias hostname ).

The alias host name is easier to remember than the regular host name. The application can call DNS to obtain the regular host name and IP address of the given alias host name.

◆ Email server alias (mall server aliasing ). The email address is obviously required to be easy to remember. For example, if Bob has a hotmail account, his email address may be a simple bob@hotmail.com. However, the host name of the hotmail email server is more complex and hard to remember than hotmail.com. The email application can call DNS to obtain the regular host name and IP address of the given alias host name. In fact, DNS allows a company's email server and Web server to use the same alias host name. For example, a company's web server and email server can both be called enterprise.com.

◆ Load distribution ). DNS is also increasingly used for load balancing among Multiple Replicated Servers (such as Web servers. Busy sites like cnn.com often copy multiple Web servers, each of which runs on an undirected terminal system and has different IP addresses. For Multiple Replicated Web servers, a group of IP addresses is associated with a single formal host name. This set of IP addresses are stored in the DNS database.

After the customer sends a DNS query for a host name mapped to a group of IP addresses, the server responds to the whole group of IP addresses, but the address order of each response is rotated. When accessing a web site, the browser generally sends the HTTP request message to the first IP address in a group of IP addresses that the DNS customer has not requested, DNS rotation distributes the access load of the web site to all the copied servers. Email applications can also use DNS rotation, so that multiple email servers can have the same alias. Recently, some companies have used DNS to provide web content delivery services in more complex ways.

DNS is described in RFC 1034 and RFC 1035 in detail and updated in several other RFC versions. DNS is a complex system. We will only discuss the key aspects of its operations here. For more information, see the Protocol documentation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.