How DNS Works: Structure and Systematics, How it Works, and Troubleshooting

The World Wide Web is a complex system that uses computer languages ​​and codes to search and exchange data. One of the most fundamental tools for the existence of the Internet is the domain name system, or DNS.

An advanced Internet user needs to understand how a DNS server works. This protocol, as part of a set of standards, exists for computers to communicate on the Internet and in many private networks. It is also known as the TCP / IP protocol suite.

Its purpose is vital, as it helps to convert easy-to-understand domain names, such as howstuffworks.com, to an Internet Protocol (IP) address, such as 70.42.251.42, which computers use to identify each other on the Web. Thus, we can summarize that this is a system of matching names with numbers. Many are curious to know how long DNS works. The system works around the clock.

DNS terminology

A domain name is a readable option, for example, Amazon.com, which is entered in the URL field of a web browser. The Internet Corporation for Assigned Names and Numbers (ICANN) manages these domain names.

Hierarchical domain name structure




The TLD top-level domain belongs to its last part. The most common TLDs include: com, net, org, and .info. Country Code TLDs represent specific geographical locations. For example, in represents India. Here are some more examples:





  • com - commercial business;
  • gov - US government;
  • edu - educational institutions such as universities;
  • org - organizations (mostly non-profit);
  • mil - military organizations;
  • net - network organizations;
  • es - European Union.

A second-level domain is a part of a domain name that is located directly in front of a TLD, for example, amazon.com. A subdomain can be created to identify unique areas of website content. For example, how DNS aws works for amazon.com.

The primary purpose of a domain name server

Computers and other network devices on the Internet use an IP address to send a request to the site you want to go to. Thanks to DNS, you do not need to have your own IP address book. Instead, they simply connect through a domain name server, also called a DNS server, which manages a huge database that maps them to IP addresses.

Basic DNS records




Regardless of whether the user accesses the website or sends email, the computer uses the DNS server to find the domain name that it is trying to access. The correct term for this process is DNS name resolution, or they say that the DNS server resolves the domain name in the IP address.





Resource record




Without DNS servers, the Internet would shut down very quickly, a similar thing happens when DNS is working with an error. Typically, when a user connects to a home network, Internet service provider via Wi-Fi, a modem or router assigns a PC network address and sends important network configuration information to a computer or mobile device. It includes one or more DNS servers that the device must use when translating DNS names to IP addresses.

IPV4 standard

IPV4 standard




Billions of IP addresses are currently in use, and accordingly, DNS servers (collectively) process billions of requests over the Internet at any given time. In addition, millions of people add and change names and IPs every day.

how DNS servers work




To understand how a DNS server with a large number of resources works, methods of expanding the effectiveness of the Web and Internet protocols are considered. In part, this means that each PC on the Network has a unique IP in both IPV4 and Internet Controlled IPV6 (IANA) standards. Here are some ways to recognize IP:

  1. In IPV4, it consists of four numbers separated by three decimal places, for example: 70.74.251.42
  2. An IPV6 IP address has eight hexadecimal numbers (base-16), separated by colons: 0cb8: 85a3: 0000: 0000: 8a2e: 0370: 7334.
  3. Since IPV6 is a new standard, so providers are mainly working on the more common IPV4.
  4. DNS works in both the first and second standard.

Each number in the IPV4 number is called an “octet,” because it is equivalent to a 10-digit number from an 8-digit (binary) number - 2, used in routing network traffic. For example, an octet written as 42 denotes 00101010. Each binary digit is a placeholder for some degree of duality from 2 to 27, reading from right to left. This means that in 00101010 there are one of 21, 23 and 25. So, to get the base-10 equivalent, just add 21 + 23 + 25 = 2 + 8 + 32 = 42. There are only 256 possibilities for the value of each octet: numbers from 0 to 255.

IANA Addresses and Bands

They define IANA as reserved IP addresses, which means they do some work on IP. For example, the IP address 127.0.0.1 is reserved to identify the computer that is currently in use.

The principle of how DNS works on a desktop or laptop computer: the IP address comes from the DHCP server on the network. His task is to make sure that the PC has an IP and network configuration that he needs when the user is connected to the Network. If it is “dynamic”, then the IP will change from time to time, for example, when the machine is turned off.

Web servers and PCs that require constant contact use static IPs when the same IP address is always assigned to the network interface of the system when it is connected to the Network. To ensure that the latter always gets the same IP address, it associates it with the MA for this network interface. Each network interface, both wired and wireless, has a unique MAC from the manufacturer.

Finding IP Address

Finding IP Address




One quick way to find the IP address is to open a command-line application in the "Accessories" section and enter the command: ipconfig. After that, you can analyze how DNS works and how long the processing speed in the browser increases. For Mac:

  • open "System Preferences";
  • Click "Network";
  • make sure that the current network connection is selected (with a green dot next to it);
  • Click "Advanced" and go to the TCP / IP tab.

Linux or UNIX, if there is no command line during the setup process, open a terminal application, such as XTERM or iTerm. At the command prompt, type: ifconfig.

For smartphones using Wi-Fi, viewing the phone’s network settings will vary depending on the version of the device and its operating system. Pay attention to the fact that if users are on a home or small local network, the address will probably be in the form 192.168.xx, 172.16.xx or 10.xxx (where x is a number from 0 to 255). These are the reserved addresses used in each local network, with the help of which the router on this network connects the device to the Internet.

Authoritative server and recursive resolver

Both concepts relate to servers, which are an integral part of the infrastructure, with each of them fulfilling its role and located at different points of the DNS. The system allows you to understand the difference - a recursive resolver at the beginning, and an authoritative server at the end.

A recursive resolver is a PC that responds to a client request and spends time tracking a DNS record. He does this by going through a series of queries, until he reaches the authoritative DNS for the desired record, if time runs out, he will return an error if it is not found. Caching is a way of storing data that closes queries for recording when looking up DNS.

Recursive recognizer




An authoritative DNS server is a server that actually contains and is responsible for recording DNS resources. This is the server at the bottom of the DNS lookup chain that will respond with the requested resource record, which will ultimately allow the web browser that completed the request to reach the IP address required to access the website or other web resources. An authoritative name server can satisfy requests from its own data without having to request a different source, since it is the final destination for certain DNS records.

There is a key difference between many DNS services and the one that Cloudflare provides. Various recursive DNS resolvers, such as Google DNS, OpenDNS, and providers, such as Comcast, support the installation of recursive DNS resolvers in data centers. These recognition tools allow you to quickly and easily perform queries through clusters of optimized DNS computer systems, but they are fundamentally different from name servers hosted in Cloudflare, which supports name servers at the infrastructure level, which is an integral part of the Internet.

Search algorithm

DNS lookup algorithm




In most cases, DNS involves translating a domain name into the corresponding IP address. To find out how this process works, it’s useful to follow the DNS lookup path as it moves from and to the web browser.

The list of steps in finding DNS:

  1. The user enters example.com into a web browser, the request moves to the Internet and is received by a recursive DNS resolver.
  2. The resolver queries the root DNS server DNS (.).
  3. The latter responds to the resolver with the DNS server address of the top-level domain (TLD), for example, .com or .net, which stores information for its domains. When searching on example.com, the request points to the .com domain.
  4. The resolver sends a request to the .com top-level domain.
  5. The TLD server responds with the IP address of the domain name server, example.com.
  6. The recursive resolver sends a request to the domain name server.
  7. The IP address for example.com is returned to the resolver from the name server.
  8. The DNS resolver responds to the web browser with the IP address of the requested domain.
  9. After DNS has returned the IP address for example.com, the browser can make a request for the web page, it sends an HTTP request to the IP address.
  10. A server with this IP address returns the web page that will be displayed in the browser.
  11. The DNS resolver is the first stop in the DNS lookup and is responsible for interacting with the client who made the initial request. The converter runs a series of requests, which ultimately translates the URL into the desired IP address.

Three types of DNS queries

Three types of DNS queries




A typical DNS lookup includes three types. By combining them, the system includes optimizing DNS resolutions through reduced distances. Data from cache entries becomes available and the DNS name server blocks a non-recursive query. A recursive request waits from the server for a response to the resource record information about the error when the resolver does not find it.

Iterative query




An iterative query allows DNS to forward the best response that the system can provide. In the case when the server does not understand the name of the request, it sends a link to the server of the low-level domain namespace, and the client sends a request to the referral address.

Non-recursive request - when the resolver client requests an access record from the DNS server, or it is present inside its cache. Typically, a DNS server will cache information to prevent additional bandwidth usage and load on upstream servers.

Browser caching

Browser caching




Modern web browsers are by default designed to cache DNS records for a specific period of time. The goal here is obvious: the closer DNS caching is to the web browser, the fewer processing steps you need to take to check the cache and make the correct requests for the IP address. When a request is made for a DNS record, the browser cache is the first verified location for the record. In Chrome, you can see the status of the DNS cache by typing in the browser line: chrome: // net-internals / # dns.

The operating system-level DNS resolver is the second and last local stop before the DNS query leaves the computer. A process in the OS designed to handle this request is usually called a “stub solver” or a DNS client. When he receives a request from the application, he first checks his own cache to see if he has a record. If this is not the case, it sends a DNS query with the recursive flag set outside the local network to the recursive DNS resolver inside the Internet service provider (ISP).

When the recursive resolver inside the provider receives a DNS query, like all the previous steps, it also checks to see if the host translation to the IP address is stored in its local constant level. The recursive resolver also has additional functionality depending on the types of entries in its cache.

Common Causes of Failures

Common causes of failures




If the DNS server does not work correctly and the Internet does not work, this situation is equivalent to triggering a fire alarm. Many problems can usually be resolved using some browser troubleshooting methods. However, if you receive the following message when starting Network Diagnostics: “Your DNS server may not be available,” you may need to perform additional troubleshooting.

There are several possible reasons why a DNS server is unavailable. This may be due to the need to update the browser cache or a router failure. The DNS server may work, but the firewall is causing problems. All of them can lead to one annoying error message. Browser related issues have a few easy fixes:

  1. Sometimes all IT problems go away after turning on / off.
  2. Performing a clear web browser cache. If updating or resetting the web browser does not work, you can try to manually clear it through the settings.
  3. The DNS server may be working properly, but there are problems with the browser. To fix the failure, try another one, for example, Safari or Mozilla Firefox. If other browsers are working, then the failure may be due to updating the current one. They will try to uninstall and reinstall it to solve this problem.
  4. If the browser works well, you may need to pay attention to the settings of your router or computer.
  5. If the settings for using, for example, a service such as OpenDNS were changed, then they could go wrong. It is recommended that you check with your network provider or administrator for what they should be, or check the OpenDNS site for server settings.
  6. Disable the firewall and antivirus software.
  7. Reboot the router. This will update the router cache and help solve the problem.
  8. They change their DNS server, it is possible that the working DNS server is unavailable because it is overloaded or does not work correctly.

Troubleshooting tools

Problems in network computing can occur at different levels, for example, servers are not configured properly. Therefore, there are special programs and applications to help users independently deal with them.

Why DNS does not work, it is easy to determine using troubleshooting tools such as nslookup that work, like checking the configuration of DNS servers. The word nslookup is short for "name server search." This is a query tool that works on both Windows and Linux.

The easiest way to use nslookup is to type the command with the domain name. For example, a command line entry and results would look something like this:

  • C: \> nslookup www.google.com.
  • Server: my.local.dns.server Address: 10.10.10.10 Unauthorized.
  • Answer: Name: www.google.com Addresses: 2607: f8b0: 4002: 80f :: 2004172.217. 4.4.

In the answer, you can see in the first section which server it uses to obtain information. In this case, it uses the local DNS server in the user network. It can be a router or provider, or even an internal corporate DNS server. The second section shows that an unauthorized response has been received. This is not something to worry about, but simply means that the server giving the answer is a recursive DNS resolver, which is very common.

You can also go online by typing nslookup at the command line. The prompt will change to ">." Here you can enter the domain name directly. If DNS does not work, and the user does not know what to do and is not satisfied with troubleshooting on the command line, there are other options available. DNSStuff offers a lot of information just by typing in a domain name. It provides a free toolkit that offers many options for analysis. His DNS report, for example, provides an assessment of pass / fail for various tests.

If the Internet DNS server does not work and the main interest of the user is troubleshooting the mail server, MXToolbox can be a place to start troubleshooting and can tell you a lot about what works and what doesn't.




All Articles