English

DNS

Updated on Apr 2, 2024 by
144

What Is DNS?

TCP/IP relies on IP addresses for device connectivity. Nonetheless, expecting users to memorize these intricate numerical identifiers proves challenging. Consequently, a host naming mechanism is employed to correlate IP addresses with user-friendly host names expressed in text format. DNS plays a pivotal role in executing the translation and query process between IP addresses and host names.

Why Do We Need DNS?

On the Internet, computers establish unique identification through IP addresses, akin to phone numbers. However, remembering these all-digit codes is challenging, given their abundance – with nearly 4.3 billion IPv4 addresses, each represented as a 32-bit binary or dotted decimal (e.g., 192.168.1.1). DNS serves the role of translating user-friendly names into machine-readable IP addresses, streamlining inter-computer connections. The DNS mechanism resembles a phonebook, managing associations between names and numerical values. Similar to searching for contacts by name rather than dialing numbers directly, we input URLs (e.g., https://www.fs.com) into browsers when navigating the Internet. Essentially, a URL functions as a computer name, commonly known as a domain name.

Composition of a Domain Name

Originally, devices used domain names comprising character sequences, forming a non-hierarchical structure. This approach resulted in both name conflicts and intricate management and maintenance issues. To tackle these challenges, the TCP/IP protocol stack introduced a hierarchical tree structure for DNS domain names. When a country seeks to join the Internet, it must register a top-level domain name with the NIC. Typically, a top-level domain denotes either an organizational type or a geographical location; for instance, "cn" for China and "us" for the United States. The NIC grants management agencies the authority to categorize top-level domains into level-2 domains. These agencies can further delegate this authority to subordinate agencies for continued classification, resulting in the establishment of a hierarchical domain name structure on the Internet. The following table describes common top-level domains.

Table 1-1 Top-level domains and their meanings

Top-level domains and their meanings

Regarding syntax, a domain name is composed of labels separated by dots (.). Consider the domain name www.fs.com for illustration. Each segment, when read from right to left, can be delineated as follows:

  • com: Designates the top-level domain name, signifying a commercial organization.

  • fs: Represents the level-2 domain name, affiliated with a company.

  • www: Indicates the level-3 domain name, denoting a standard web page.

DNS Server, Client, and Relay Agent

DNS-related device roles on a network include DNS server, client, and relay agent.

DNS Server

A DNS server is responsible for associating a domain name with its corresponding IP address. The server maintains a table containing domain names and their respective IP addresses to resolve the domain names used in messages. Due to the global nature of the Internet, where resources are interconnected worldwide, a single DNS server cannot handle all address translation operations. As a solution, multiple DNS servers collaborate globally.

Similar to the hierarchical structure of domain names, DNS servers also adopt a hierarchical arrangement. When a user seeks to resolve a domain name, they sequentially request information from top-level and authoritative DNS servers through the root DNS server to acquire the corresponding IP address. The obtained result is stored on the local DNS server for subsequent DNS requests. In the event of a repeated access request to the same domain name, the user can directly retrieve the result from the local DNS server without the need to initiate a global recursive query again.

Table 1-2 DNS server classification

DNS server classification

DNS Client

A DNS client is responsible for receiving DNS requests from user programs and providing responses. A device operating as a DNS client possesses the following functionalities:

  • Initiating DNS resolution For the DNS client function to be operational, it is necessary to enable DNS resolution on the device.

  • Specifying the IP address of a server To facilitate DNS domain name resolution, it is essential to designate the IP address of a DNS server on the device. This allows query requests to be directed to the specified server for resolution.

  • Specifying the DNS domain suffix search list DNS clients often access servers or hosts with similar domain name suffixes. By predefining specific domain name suffixes, users can input only a portion of a domain name. The system then automatically appends a designated suffix to resolve the domain name. For instance, configuring "com" in the suffix list and entering "fs" in a domain name query associates "fs" with the suffix "com," initiating a search for "fs.com."

DNS Relay Agent:

In the event of a DNS server's IP address changing, updating the configuration for every DNS client across the user network can be a laborious and error-prone task. To address this challenge, the deployment of a DNS relay agent proves beneficial. In such instances, configuring the IP address of the DNS relay agent on a DNS client and specifying the IP address of the DNS server on the DNS relay agent is recommended. Subsequently, the DNS client directly dispatches a DNS request packet to the DNS relay agent, which then forwards the packet to the DNS server. This approach simplifies network management by requiring configuration changes only on the DNS relay agent in the case of DNS server IP address modifications.

Operational principle of the DNS relay agent:

  • The DNS client transmits a DNS request packet to the DNS relay agent, with the destination address being the IP address of the DNS relay agent.

  • Upon receiving the request packet, the DNS relay agent forwards it to the DNS server for domain name resolution.

DNS Domain Name Resolution Process

The procedure of acquiring an IP address based on a domain name is termed domain name resolution. DNS domain name resolution encompasses the following categories:

Static domain name resolution:

This method necessitates a static domain name resolution table, manually crafted to contain associations between frequently used domain names and their respective IP addresses. In this process, a DNS client initially searches the static domain name resolution table for the desired domain name to efficiently translate it into an IP address.

Dynamic domain name resolution:

This type of resolution relies on a dedicated DNS server, which operates the domain name resolution program, establishing mappings between domain names and IP addresses, and responding to DNS requests from clients. To expedite DNS queries, static domain name resolution is employed first. If this proves unsuccessful, dynamic domain name resolution is then activated.

The DNS operates through the following steps:

1. A user program, like ping or Telnet, initiating network access with a domain name, sends a DNS request to the DNS client's resolver.

2. The resolver first checks the local cache:

- If the mapping entry for the domain name is found in the local cache, the resolver promptly furnishes the corresponding IP address to the user program.

- If the local cache lacks such an entry, the resolver dispatches a request to the DNS server.

3. The DNS server evaluates whether the requested domain name is within a sub-domain it manages, responding accordingly:

- If within its managed sub-domain, the DNS server searches its database for the corresponding IP address.

- If outside its managed sub-domain, the DNS server forwards the request to upper-level DNS servers. Upon resolution, the relevant upper-level DNS server transmits the outcome to the DNS client.

4. The resolver receives and interprets the response from the DNS server, delivering the result to the user program.

Dynamically resolved mappings between domain names and IP addresses are stored in the cache. Upon subsequent searches for a domain name, the DNS client retrieves the corresponding IP address directly from the cache, bypassing the need to send a request to the DNS server. To ensure the latest mappings, entries in the cache expire and are deleted after a period.

You might be interested in

See profile for undefined.
FS Official
BGP
See profile for undefined.
FS Official
Eth-Trunk
See profile for undefined.
FS Official
M-LAG