What is DNS and what to do if the DNS server is not working? What is dns? What is an external DNS server?

What is DNS and what to do if the DNS server is not working? What is dns? What is an external DNS server?

12.05.2023

Good day, dear subscribers and guests of the blog. You've probably heard the acronym DNS and probably understand the basics. However, for many it is a confusing term. Therefore, today I will try to explain as clearly as possible what a DNS server is and how to configure it, I will tell you the principles of its operation and why it is needed. Let's get started!

Meet us! DNS

So DNS stands for "Domain Name System". If you know English, then you already understand what will be discussed. The term translates as "Domain Name System". This is a kind of distributed storage, a database in which keys and values ​​are stored, or rather IP addresses and their corresponding domain names. To understand why this is needed, let’s take a moment to dive into history.

We use all this every day. Thanks to this technology, we easily navigate through services and quickly find the information we need without hesitation. And all because every resource on the Internet has its own IP address, which looks, for example, like this: 87.245.200.148, and the corresponding .

In this case it is www.google.com.ua. This system appeared because it is not convenient for network users to remember the numeric addresses of sites. Thus, when a user enters a specific website name in the DNS system, a complex process of searching for its IP occurs and vice versa. By the way, one IP address can be assigned several domain names, and vice versa, one domain name can be assigned many IP addresses.

Previously, such information was recorded in one single file and stored by users on local computers. However, the World Wide Web grew and this method quickly became irrelevant. It was replaced by a domain name system developed in the second half of the 20th century by Paul Mockapetris.

Domain Name System consists of many levels, each of which has its own domain records. It is interesting that the higher the domain hierarchy, the further to the right it is located when writing the site address.

The root of such a hierarchical tree is the dot – “.”. It is followed by first-level domains. These include the following names: org, com, net, int, edu, gov, info, pl and others. This also includes the indication of the country. For example, ru, ua, etc. Next come the next levels.

Due to the huge number of domains, they were all divided into zones - a certain part of the names that is stored as a whole on one or more DNS servers.

When performing some kind of request on the Internet, a very interesting and complex thing happens. When a user sends a request, it is sent to the server. The server, in turn, checks whether it can produce the result.

If it cannot determine the answer, it forwards the request further to the root or higher-level DNS server. This upward movement is called “Ascending Hierarchy.” After obtaining the required result, the movement changes its direction and transmits information in the reverse order.

By the way, depending on the method of issuing a response, DNS servers are divided into two types: recursive and non-recursive (iterative). In short, the first type of request performs a full search of all references to various servers and independently queries them, and then caches all received records. In the second case, the referrals are returned to the user and he must check them himself.

I told you only the general principles of DNS functioning, which give you an understanding of what is happening in . However, this is not all.

Why set up a DNS server for your website?

As I already said, each site has its own IP address and domain name. Depending on how often you move to a new hosting, the server also changes. This means that the IP also changes. Therefore, the key-value relationship is not constant.

And if you do not configure all of the listed indicators, then your resource will become unavailable for search, since it will not respond when called to the old address. In another case, if the DNS records about your resource are deleted from the old one, then the domain name will send network users into the void and then the last error will be displayed.

Therefore, when changing providers, be sure to update information about the location of your site: check the domain, IP value and all other parameters.

If you have done everything as written above, but no changes have occurred, do not be alarmed. New instructions for connecting to the site take quite a long time to take effect. This may take from 24 to 72 hours. Although some people are very lucky and registration takes about 5 hours. Why is this so?

It all depends on which DNS servers and at what time the information will be updated. When new parameters are entered, these records are transferred to other domain name servers and the old data is overwritten there. However, many DNS are configured to periodically update information, which results in a delay in updating data.

Of course, other problems happen when you change the address of a web resource and you don’t always know for sure how to correct the situation. To do this, they provide their customers with technical support. And advanced resource owners can find a solution themselves over time.

On this note, I bid you farewell. Subscribe to my blog updates. Thank you in advance for the reposts. Bye bye!

Best regards, Roman Chueshov

It’s hard to imagine modern life without the Internet. He follows us everywhere. Even watches and microwaves have internet. Most people are not particularly interested in the principle of operation and a general understanding of how the network works.

In the near future, not knowing the basics of computer network topology will simply be ugly. And today we will look at what DNS is and what it comes with.

Basic Concepts

Domain Name System(DNS) literally means domain name system in English. Such a system is designed to receive information about domains, is part of the TCP / IP family and has an application layer according to the OSI model.

In its turn, TCP/IP is a protocol for transferring information from one computer to another. Moreover, if several PCs are connected via local network and do not have access to the Internet, data exchange between them is carried out using this protocol.

OSI model- this is the basis of computer networks; it is thanks to this model that data exchange between devices is in principle possible. Note that there are only seven levels of the model, the application level is the very first.

Domain it represents the direct address of the portal or a strictly identified zone where the site addresses are located, while having its own unique name in the organization of the domain name system. Domains come in different levels, but the domains below the second level are called subdomains.

What does the domain ultimately give? It allows you to learn a lot about the site. The name of the site always contains: .com - this means that the specified site is commercially oriented, .ru - the site is located in the segment of the Russian-language Internet - the same “Runet”. Let's look at the state procurement portal located at: http://zakupki.gov.ru, where .gov means that the site is run by the state, and .ru means it belongs to the Russian naming zone.

Now we need to understand what it is IP address. The machine does not understand our letters, since it works exclusively in the binary number system (which includes only two numbers 0 and 1). The IP address appears in the form of numbers that serve for the convenience of setting up the network, addresses of network nodes (devices that can exchange data and assign an IP, for example, a smartphone, printer, router, etc.), using the decimal system, the machine itself translates the numbers into binary, and thus understands where to go with a request to receive data and exchange the corresponding packets.

For example, the address of most home routers is designated as 192.168.1.1 in binary code it will look like 11000000.10101000.00000001.00000001. There is a joke among system administrators that every self-respecting system administrator should be able to mentally convert an IP address from decimal to binary.

It looks complicated on paper, but thanks to DNS we enter ya.ru in the address bar and get to the Yandex website. That is, the primary task of DNS is to simplify the search for various Internet portals and interpret domain names into IP addresses.

DNS structure

The domain name system has a tree structure and includes many elements: the domain names themselves, zones, network nodes, etc.

The root zone contains countless servers that process various requests every second. The setup takes place on different “mirrors”, which include information about the servers themselves and are responsible for the domains. Such actions are performed on computers scattered around the world and located at a significant distance from each other.

We have already talked a little about the concept of a zone in the DNS system. But, continuing the example with the tree, we note that a zone can be considered any section of our tree that combines several branches into one, which allows us to transfer control, and, consequently, responsibility for the specified zone of the tree to an organization and person.

Every zone includes a component called the DNS Service. The service allows you to store data locally. The domain itself in our tree will look like a simple branch.

It is also worth paying attention to the fact that the DNS system is hierarchical. This means that all domains, in addition to the root one, are subordinate to higher-level elements of the system.

Taxonomy of DNS servers

A DNS server is a device on which the corresponding application is installed and running, responding to requests from other devices using network protocols.

All servers are divided into:

What does this all look like in practice? Let's assume that someone decided to launch a new website on the Internet. For these purposes, a new domain is registered. But until this domain is entered into special tables on DNS servers, we can say that no one in the world knows this domain and will not be able to connect to it. After making changes to DNS, it will immediately report the latest information to other servers in the hierarchy.

User Information

When making the initial connection and laying cable into a home, as a rule, in the service contract, the provider, in addition to the login and password, indicates its DNS servers, which the user must enter when setting up the router or computer. A number of providers link addresses automatically.

However, the most sophisticated users use free alternatives from large IT companies such as Google or Yandex. Thus, Yandex servers include more than 80 DNS.

The speed of opening pages in the browser can directly depend on which DNS server is used. Of course, one cannot dream that the speed will increase significantly, but it is worth keeping in mind that there will be a slight increase. To understand which server to register in the settings, you can use a special software, such as DNS Benchmark, Namebench, etc.

You can find routers on the market that have a built-in DNS server. But you also often come across devices that do not have a server. Such devices use the DNS relay function. This feature allows you to forward data packets without the need for a DNS server built into the kernel operating system router. But if you disable this function, then the entire load of working with domains will transfer to the equipment next in level to your router, that is, to the provider’s equipment.

If the DNS server does not respond

A common mistake. The problem can arise either due to problems in the user’s network or on the part of the provider. Solutions:

DNS is a service that facilitates communication between different network segments. Its use can significantly reduce the time spent searching for information. In this article you will learn about the basic principles of operation of the service, as well as methods and forms of data transmission on the Internet.

How does it work

At the dawn of the Internet, there was a “flat” naming system: each user had a separate file, which contained lists of contacts he needed. When he connected to the World Wide Web, his data was sent to other devices.

However, due to the rapid development of the Internet, it was necessary to simplify data exchange as much as possible. Therefore, it was divided into smaller segments-domains. In turn, they are divided into subdomains. At the top of the address, submitted in the nominal form, there is a root - the main domain.

Since the Internet is an American development, there are two types of primary domains:

  • generic domains that belong to US institutions:
  1. com – business organizations;
  2. gov – government agencies;
  3. edu – educational institutions;
  4. mil – military missions;
  5. org – private organizations;
  6. net – Internet provider.
  • The indigenous domains of other countries consist of two letters.

The second level consists of abbreviations for cities or regions, and third-order domains denote various organizations and enterprises.

The dot acts as a separator between domains of different order. There is no dot at the end of the name. Each individual domain with a dot is called a label.

Its length should not exceed 63 characters, and the total length of the address should be 255 characters. Basically, the Latin alphabet, numbers and hyphens are used, but several years ago they began to use prefixes based on other writing systems. Letter case does not matter.

Servers are computers that contain a list of other objects within one network level, which allows for faster exchange between users. They became the basis of the new system.

Each network level must have its own server, which contains information about the addresses of users in its segment.

Searching for the necessary data goes like this:


DNS Basics

A node consisting of several domains is called a zone. Its file contains the main parameters of its segment. This includes information about the FQDN or fully qualified domain name. If such an entry ends with a dot, this means that the object name is specified correctly.

There are several types of computers that serve DNS:

  • master– main agent of the network. He can change its configuration;
  • slave– second order devices. They serve clients equally with the master and can replace him in case of problems. This allows you to relieve the network;
  • caching. Contains information about domains of foreign zones;
  • invisible. Missing from the zone description. Most often, this status is assigned to users with master status in order to protect them from attack.

The user can send one of two types of requests to them.

The browser sends it through the resolver program:

  • recursive. If the server does not contain the necessary information, in this case it will obtain the necessary data from the computers top level and sends a response to the client. This allows you to reduce the number of requests and saves time and your traffic;
  • iterative. The server sends a ready response, selecting information only from its own cache (memory). If it does not have suitable data, it provides a link to other computers. The browser then goes to this address.

There are two types of responses:

  1. authoritative– if the data is sent from a device that serves the network;
  2. non-authoritative. Sent another computer, which obtains the necessary data from its own cache or after an iterative query.

Video: DNS Service

Names and IP addresses

The DNS service provides translation of website names into IP addresses. On the Internet, each device can be tracked by 2 main parameters - domain name and IP address. They can be assigned to the user's computer, network printer, or router.

However, this is very conditional, since a computer may not have a domain name, but use several addresses. In addition, each IP address must match all domain names. However, a domain can only contain information about one IP address.

Operating mode

Servers can operate in the following modes:

  1. maintenance of your own zone. Data exchange takes place between the master and slave computers. However, requests from unauthorized users are not accepted;
  2. performing a recursive question;
  3. forwarding– the server sends a request to another zone.

Changing DNS settings

Typically these parameters are set by the network in automatic mode. In order to reset the data, you need to go to the “Network Connections” section.

Photo: changing DNS server parameters

After that, you need to enter the protocol used to maintain the network.

In the “Properties” section you can set the necessary parameters. Usually the main IP address of the server and an alternative one are indicated.

Message Format

The message that is used to exchange information between the service begins with a 12-byte header. This is followed by an identification field that allows you to determine which request was answered.

The flags field (the next 16 bits) includes the information:

  1. message type;
  2. operation code;
  3. identification of authoritativeness (i.e. shows whether the serving computer belongs to the network);
  4. TC flag. Displays whether the message arrived truncated or full.
  5. recursion flag, i.e. requirements for the server to send requests to higher-order computers;
  6. recursion capability flag. Shows the server's ability to redirect messages;
  7. return code. Displays whether the response was sent with errors or not.

The last 16-bit field shows the total number of parameters taken into account.

Questions in DNS request

Part of the resource record in the response

Any response contains information about the party that sent the message. It contains the following data: response, server credentials and Additional Information about him.

In addition to them, the message contains:

  • domain name;
  • request type;
  • validity period of the cached version;
  • resource record length – an estimate of the amount of information.

Index queries

Pointer queries are aimed at searching for a page in inverse mode, i.e. searching for a resource name by IP address, given as a text string separated by dots.

To send it, the host address is written in the opposite order with the addition of a certain suffix (most often in the form in-addr.arpa).

The operation can be performed if the resource contains a PTR record. This allows control of the zone to be transferred to the owner of the IP addresses.

Resource records

This is a list of the main programs used by the service. Within one domain, these records are unique. Duplicates of these records may exist at different levels of the network.

This data includes the following types of records:

  1. SOA–start of powers. It allows you to compare a domain and the computers serving it. They also contain information about the validity period of the cached version, and the contact person who services the server of a certain level;
  2. A contain a list of IP addresses and their corresponding hosts. They allow you to identify the address of domain resources;
  3. NS (Name Server) include a list of computers that serve the domain;
  4. SRV (Service) display all resources that perform the most important functions of the service;
  5. MX (Mail Exchanger) allow you to automatically configure the distribution of data to serving computers within the boundaries of one domain;
  6. PTR (Pointer) used to search for a resource name if the user knows its IP address;
  7. CNAME (Canonical Name) allow the server to be referred to under multiple aliases within the service.

Caching

To find the information you need, the browser can search for information in three segments. First, the necessary data is searched using the DNS service, i.e. at the local level. They can be found if your computer contains a Hosts file.

However, if the operation fails, the client submits a request. To speed up the search for information, cached servers are used. If it does not find the required data, then it performs a recursive query. When served, it copies data from other networks.

Photo: setting up a caching DNS server

This allows you to save traffic without subsequently contacting authoritative users. But an open entry remains valid for a limited period. Its validity period is set in the zone file. The default minimum is 1 hour.

UDP or TCP

The service supports both UDP and TCP protocols.

UDP is used to send messages over global networks. The size of messages sent via this protocol is limited. Incomplete answers contain the TS label. This means that the response size exceeded 512 bytes, so the rest did not reach the computer.

It is less reliable because it does not have a specific timeout for request response. However, such a system is suitable for transmitting huge amounts of information.

TCP is used to transmit such data because it allows you to receive any amount of data divided into segments of a certain size.

This protocol is also used by secondary servers when they request data from host computers every three hours to learn about updates to the network configuration file.

The DNS service has a complex hierarchical structure. However, the server system provides flexible and fast interaction between all users and devices of the Network.

To find out the necessary information, the client sends a request. The response contains basic data about the object of interest and the computer serving the zone. To carry out this exchange, the UDP and TCP protocols are used.

What is a DNS server, how does a DNS server work?

What is a DNS server

A DNS server is a server that allows you to convert symbolic domain names into IP addresses, and vice versa.

A domain is a specific zone in the domain name space, which must be assigned at least one IP address.

How DNS works

The DNS service is used to map a domain name to an IP address. The DNS system consists of many servers at different levels; each network must have its own DNS server, which contains a local database of DNS records.

How it works:

  • The client makes a request to the local DNS server, for example, you typed the website address in the address bar of your browser;
  • If the local DNS contains this entry, then it gives the answer. In our example, the browser will receive the IP address of the site and contact it.
  • If the local DNS does not have the required entry, then it contacts the next DNS server, and so on, until the entry is found.

One IP address can be associated with many domain names - this is called virtual hosting. But one domain name can be assigned multiple IP addresses, usually to distribute the load.

DNS Server Records

The DNS server has several types of records, let's look at them:

SOA Record creates a zone for a domain, for example, we need to add the domain exempl.com, then we first need to create a SOA record, which will indicate on which server the information about this domain is stored. The SOA record has several parameters:

  1. Serial- serial number zones. It increases every time changes are made in a given domain; this is necessary to detect changes from the secondary DNS server and determine the need to update its cache.
  2. Refresh - update period. The period in seconds after which the secondary DNS server should check the serial number of the primary server for changes, and update the data if necessary.
  3. Retry - repeat the update. Sets the frequency of attempts to update the secondary DNS when connecting to the primary fails. Set in seconds.
  4. Expire - the period for storing primary DNS data on the secondary, in case of unsuccessful attempts to connect and update data.
  5. TTL is the lifetime of records for this zone in the cache of secondary DNS servers. For example, the lifetime A of a given zone record on secondary servers. If the data changes frequently, it is recommended to set the value to a small value.

NS entry(name server) - points to the DNS server for this domain, that is, to the server where A records are stored.

example.com IN NS ns1.ukraine.com.ua

Record A(address record) - this record indicates the IP address of the domain.

example.com IN A 91.206.200.221

CNAME record(canonical name record) indicates a synonym for this domain, that is, this domain will be assigned the IP address of the domain to which this record refers.

example.com IN CNAME xdroid.org.ua

MX Record(mail exchange) points to the mail server for this domain.

example.com IN MX 10 mail.example.com

An additional digit in front of mail.example.com indicates the priority value - a smaller digit means a higher priority.

PTR Record(Pointer) - is the reverse of the A record. Searching for an IP address by domain is carried out using the A record, and searching for a domain by IP address is carried out using PTR records. It makes sense to set PTR records only on physical hosting, since on virtual hosting all names have the same IP.

This is not a complete list of DNS server records, but we have looked at the main records.

Full list of DNS records:

  1. SOA (start of authority record)
  2. NS (name server)
  3. MX (mail exchange)
  4. A (address record)
  5. CNAME (canonical name record)
  6. TXT (Text)
  7. PTR (Pointer)
  8. SRV (Server selection)
  9. AAAA (IPv6 address record)
  10. AFSDB (AFS data base location)
  11. ATMA (ATM address)
  12. DNAME (Name redirection)
  13. HINFO (Host information)
  14. ISDN (ISDN address)
  15. LOC (Location information)
  16. MB (Mailbox)
  17. MG (Mail Group Member)
  18. MINFO (Mailbox or Mail list info)
  19. MR (Mail rename)
  20. NAPTR (Naming Authority Pointer)
  21. NSAP (NSAP address)
  22. RP (Responsible Person)
  23. RT (Route through)
  24. SPF (Sender Policy Framework)
  25. SRV (Server Selection)
  26. X25 (X.25 PSDN address)

Don't forget to leave

Types of DNS servers

Based on the functions they perform, DNS servers are divided into several groups; depending on the configuration, a specific server can be of several types:

  • authoritative DNS server - a server responsible for a certain zone.
    • A master or primary server (in BIND terminology) is a server that has the right to make changes to zone data. Typically there is only one master server for a zone. In the case of a Microsoft DNS server and its integration with Active Directory, there can be several master servers (since the replication of changes is carried out not by the DNS server, but by Active Directory, thereby ensuring the equality of the servers and the relevance of the data).
    • A slave or secondary server that does not have the right to make changes to zone data and receives messages about changes from the master server. Unlike the master server, there can be a (virtually) unlimited number of them. The slave is also an authoritative server (and the user cannot distinguish between the master and the slave, the difference appears only at the stage of configuring/making changes to the zone settings).
  • Caching DNS server - a server that serves client queries (receives a recursive query, fulfills it using non-recursive queries to authoritative servers, or passes the recursive query to an upstream DNS server)
  • Local DNS server; used to serve DNS clients running on the local machine. In fact, it is a type of caching DNS server configured to serve local applications.
  • Forwarding DNS server; (English) forwarder, internal DNS server) a server that forwards received recursive queries to an upstream caching server in the form of recursive queries. Used primarily to reduce the load on the caching DNS server.
  • Root DNS server is a server that is authoritative for the root zone. There are only 13 commonly used root servers in the world, their domain names are located in the root-servers.net zone and are called a.root-servers.net, b.root-servers.net, ..., m.root-servers.net. In certain local network configurations, it is possible to configure local root servers.
  • Registration DNS server. A server that receives dynamic updates from users. Often combined with a DHCP server. In the Microsoft DNS server, when running on a domain controller, the server operates in the registration DNS server mode, receiving information from domain computers about the correspondence of the name and IP of the computer and updating the domain zone data in accordance with it.
  • DNSBL server (server with black lists of addresses and names). Formally, such a server is not part of the DNS hierarchy, but uses the same mechanism and protocol to operate as a DNS server.

Types of DNS queries

Direct request

Direct (forward) request - a request to convert a host name (symbolic address) to an IP address.

Request

Reverse request - a request to convert an IP address to a hostname.

Recursive query

A recursive request involves obtaining a final response from the server to which it is directed. The recursion is performed by the server.

Iterative Query

Iterative query - assumes (allows) recursion to be performed by the client.

View

Some servers support the ability to work in different modes for different network segments. In Bind this mode is called view. For example, the server can give for local addresses (for example, 10.0.0.0/8) local addresses servers, for external network users - external addresses. A server can also be authoritative for a given zone only for a specified range of addresses (for example, in the 10.0.0.0/8 network, the server declares itself authoritative for the internal zone, while for external addresses, in response to a request for a name from the internal zone, the answer “unknown” will be given ").

Ports used

All RFC 1035 DNS servers respond to TCP and UDP port 53. Early versions of BIND used port 53 when sending requests, newer ones behave like DNS clients, using free unregistered addresses.

© 2023 hecc.ru - Computer technology news