Understand the ins and outs of DNS in one article

Understand the ins and outs of DNS in one article

[[333115]]

1. Background

By the late 1970s, the ARPAnet was a small, friendly network of a few hundred hosts. All that was needed to know about hosts was a single file called HOSTS.TXT: it contained the name-to-address mappings of all the hosts connected to the ARPAnet.

The HOSTS.TXT file is maintained by SRI's Network Information Center (NIC) and distributed from a host SRI-NIC to the entire network. ARPAnet administrators usually notify the NIC via email and regularly FTP to SRI-NIC to obtain the latest HOSTS.TXT file.

However, as ARPAnet grew, this approach no longer worked. Changes to each host would result in changes to HOSTS.TXT, which would require all hosts to obtain updated files from SRI-NIC. When ARPAnet adopted TCP/IP, the number of hosts on the network grew explosively, and the following problems arose:

  • Traffic and load:
  • Name Conflict:
  • consistency

2. DNS Introduction

DNS (Domain Name System) is a distributed database on the World Wide Web that maps domain names to IP addresses. It allows users to access the Internet more conveniently without having to remember IP numbers that can be directly read by machines. The process of obtaining the IP address corresponding to a domain name through a domain name is called domain name resolution (or host name resolution). The DNS protocol runs on the UDP protocol and uses port number 53. In the RFC document, RFC 2181 has a specification for DNS, RFC 2136 describes the dynamic update of DNS, and RFC 2308 describes the reverse cache of DNS queries.

3. DNS Data Structure

3.1 DNS Record Types

The correspondence between domain names and IP addresses is called a "record". It is divided into different types according to different purposes. Common DNS record types are as follows:

  • A: Address record (Address), returns the IP address pointed to by the domain name.
  • NS: Domain Name Server record (Name Server), returns the server address that stores the next-level domain name information. This record can only be set to a domain name, not an IP address.
  • MX: Mail eXchange, returns the server address for receiving emails.
  • CNAME: Canonical Name record, returns another domain name, that is, the domain name currently queried is a jump to another domain name.
  • PTR: Pointer Record, which is only used to query domain names from IP addresses.

3.2 Working Principle

DNS service working process

When a DNS client needs to query a name used in a program, it queries a local DNS server to resolve the name. Each query message sent by the client includes three pieces of information to specify the questions that the server should answer.

Specifies the DNS domain name, expressed as a fully qualified domain name (FQDN).

Specifies the query type, which can specify resource records by type, or be a specialized type of query operation.

The specified category of a DNS domain name.

For DNS servers, it should always be specified as the Internet class. For example, the specified name can be the fully qualified domain name of the computer, such as im.qq.com, and the specified query type is used to search for address resource records by that name.

DNS queries are resolved in a variety of different ways. Clients can also sometimes answer queries locally by using cached information from previous queries. A DNS server can answer queries using its own cache of resource record information, or it can query or contact other DNS servers on behalf of the requesting client to fully resolve the name and then return the answer to the client. This process is called recursion.

In addition, the client can also try to contact other DNS servers to resolve the name. If the client does this, it will use independent and additional queries based on the server's answer. This process is called iteration, that is, the interactive query between DNS servers is an iterative query.

DNS query process

https://my.oschina.net/u/4007037/blog/3098159

<<:  The future is here: Will 5G users reach 2.6 billion by 2025?

>>:  The Advancement of WiFi 6 Wireless Router Market Report for the First Half of 2020

Recommend

5GRedCap: The role of RedCap in 5G evolution

3GPP Release (Rel) 17, due in mid-2022, introduce...

CloudCone: $8.1/year KVM-768MB/18GB/2TB/Los Angeles data center

CloudCone also launched a promotion for Double 12...

G Suite vs. Office 365: Which is the right productivity suite for your business?

Choosing an office suite used to be a simple matt...

How far will eSIM cards go in 2018?

The eSIM card was mentioned as early as 2011. The...

Will 5G play a big role in supporting the next generation of smart cities?

As cities become more crowded and complex, the ne...

2021 China Internet Haha List 2: Top Ten Events

In 2021, the Internet industry has emerged with m...

Virtual Private Server Operation Beginner's Guide

A Virtual Private Server (VPS) is a popular hosti...

The rise of cybercrime today: how to deal with cybersecurity threats

Cybersecurity professionals are constantly protec...

The number of 5G mobile phones will reach 250 million. Is this good news?

According to a new research report released by St...