Home >Common Problem >What is the role of dns

What is the role of dns

青灯夜游
青灯夜游Original
2023-03-02 14:29:4068232browse

The function of dns is to resolve domain names (web addresses) into IP addresses. DNS refers to the domain name system, which is a distributed database that can map domain names and IP addresses to each other. It allows people to access the Internet more conveniently without having to remember IP strings that can be directly read by machines. Domain name resolution process: 1. The client sends a domain name query request to the DNS server; 2. The DNS server informs the client of the IP address of the Web server; 3. The client communicates with the Web server.

What is the role of dns

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

What is dns? What is the function?

DNS is the domain name resolution protocol

DNS is the abbreviation of Domain Name System (Domain Name System) and is a core service of the Internet. As a distributed database that can map domain names and IP addresses to each other, it can make people access the Internet more conveniently without having to remember IP strings that can be directly read by machines. This is also the official statement of DNS.

To put it bluntly: communication is carried out through IP addresses on the Internet. However, IP addresses are expressed in numbers, which are difficult to remember (such as 116.213.120.232), so each IP is given a domain name that is easier for humans to remember (such as www.google.com), and DNS is used to resolve the domain name into IP (parse the naming format that is easy for people to understand into a format that the computer can understand, or translate the IP into a domain name)

The role of the DNS service: Resolve the domain name into an IP address.

DNS links domain names and IP addresses for services, so you don’t have to enter the IP address, but access the website by entering the URL. Each IP address can have a hostname, which consists of one or more strings separated by decimal points.

  • The client sends a domain name query request to the DNS server (the DNS server has its own IP address)

  • The DNS server informs the client of the web server IP address

  • Communication between client and Web server

What is the dns server used for?

The role of the DNS server is to convert domain names into IP addresses that can be recognized by the network. First of all, in order to facilitate access to servers on the network, each server is assigned a different IP address. However, there are too many websites on the Internet, and it is impossible to remember the IP address of each website. At this time, domain names appear.

DNS is a core service in the Internet. It is a distributed database used to map domain names and IP addresses to each other. It translates simple and clear domain names into IP addresses that can be recognized by computers, allowing users to Access the Internet faster and more easily. Simply put, DNS is equivalent to a phone book on the Internet, recording IP addresses and corresponding domain name information, making it easy for users to query and access.

dns domain name resolution process

1. Recursive query

Suppose the host in the picture wants to know the IP address of the domain name y.abc.com. The host first makes a recursive query to its local name server. After receiving the request for recursive query, the local domain name server also queries a root domain name server using recursive query. After receiving the request for recursive query, the root domain name server uses recursive query to query a top-level domain name server. After receiving the request for recursive query, the top-level domain name server uses recursive query to query a certain authority domain name server.

What is the role of dns

When the IP address corresponding to the domain name is queried, the query results will be passed between the previously entrusted domain name servers and finally returned to the user host

What is the role of dns

2. Iterative query

Since the recursive query places too much burden on the queried domain name server, The following pattern is usually adopted: the query from the requesting host to the local name server is a recursive query, while the remaining queries are iterative queries.

The host first performs a recursive query to its local domain name server, and the local domain name server uses an iterative query. It first queries a root domain name server, and the root domain name server tells the local domain name server. The local domain name server performs an iterative query to the top-level domain name server for the IP address of the top-level domain name server that should be queried next time. The top-level domain name server tells the local domain name server the IP address of the authority domain name server that should be queried next time. The local domain name server performs an iterative query to the authority domain name server. The authority domain name server tells the local domain name server the IP address of the domain name being queried. The local domain name server finally tells the host the result

What is the role of dns

3. Cache

  • In order to improve DNS query efficiency, reduce the load on the root domain name server and reduce the number of DNS query messages on the Internet, cache is widely used in domain name servers. The cache is used to store records of recently queried domain names and where the domain name mapping information was obtained.
  • Since the mapping relationship between domain names and IP addresses is not permanent, in order to keep the contents in the cache correct, the domain name server should set a timer for each item and delete items that exceed a reasonable time (for example, every Items are only stored for two days).
  • Cache is not only needed in the local domain name server, but also in the user host. Many user hosts download the entire database of domain names and IP addresses from the local domain name server at startup, maintain a cache of their recently used domain names, and only query the domain name server when the domain name is not found in the cache. In the same way, the host also needs to maintain the accuracy of the contents in the cache.

If a user has queried the IP address of the domain name y.abc.com not long ago, the IP address corresponding to the domain name should be stored in the cache of the local domain name server.

What is the role of dns

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What is the role of dns. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Does dpi mean resolution?Next article:Does dpi mean resolution?