What is DNS for: concept, purpose, principle of operation and functions performed

It is quite natural that ordinary users know little about why DNS is needed and what functions are assigned to the technology of the same name and the corresponding servers. But even a child, if you ask him about visiting a site on the Internet, will immediately say its name or the English language abbreviation for the address of the resource, without even knowing that all this information is purely conditional. Further, it is proposed to briefly consider some fundamental principles of operation and use of DNS, which may be useful to many in the future, for example, to understand some solutions that can eliminate the problems of access to local networks or even the Internet.

Why is DNS necessary?

So, let's start with the simplest and try to explain the main purpose of the technology itself and the principles of its application in practice, taking as a basis the simplest examples. Absolutely all users know that to access some kind of Internet resource (site) in the address bar of the browser you need to enter a special URL, which can consist of a set of letters, numbers and symbols. Most often, easily remembered addresses are used, which are either full names or abbreviations from the main names. But few people realize that a computer is just a machine and cannot recognize such names. In other words, in order to redirect you to some site, it must receive a clear address, expressed exclusively in numerical form. But after all, it will be very problematic for a person to remember a huge number of such combinations.





Matching the IP address of a domain name




That is why at one time the Domain Name System (DNS) was developed , which allows converting ordinary names to digital addresses, and when establishing a connection between the client computer and the server on which the requested page is stored, redirecting requests and responses is not chaotic , but only between specific computers.

General DNS Principles

Now let's try to figure out what DNS is for, using a few simple life examples. Let's say you have a friend with the name of Peter Ivanov, who lives in a city. There can be a lot of such Ivanovs in this village. And if you need to deliver mail to him, will you not look for all the people with that name, randomly running around the city and asking passers-by? But the person you need lives at a certain address, which means that to find exactly who you need, you will go right to his house. It is clear that in this case the mail will be received by the person to whom it is addressed. But why do we need DNS when applied to computers?

DNS Principle




The analogy here is obvious: the domain name is the name and surname of the recipient (and for the Internet this is the URL name of the site), and the mailing address allows you to immediately find the right person (for computers this is binding to the IP address into which the machine converts the domain name )





Do I need a DNS server?

Everything seems to be quite simple. However, in practice this is far from the case. The main problem, based on the above example, is that you can forget the address or phone number of the right person. To prevent this from happening, you can enter his phone number, for example, in the contact list on a mobile device. This is necessary at least for the fact that at some point in time a person may not be at home. But you can call him and specify the time when you can deliver the correspondence to the specified address. In order to call a subscriber, you will find in the phone book you need a person by the recorded name, and then just press the call button without even looking at the number assigned to the contact.

DNS server as a phone book




I think it’s already becoming clear why a DNS server is needed, because by itself it just acts as a kind of notebook, which stores all registered numbers along with the names of their owners. But this is only the simplest comparison.

Types of DNS Servers

As for the servers themselves, they are divided into two main types: primary and secondary. What is the first type of DNS server for? It is precisely the main repository of all registered domain names with the assigned IP addresses. In a sense, this is a kind of common database. The second type of server plays an equally important role - it is responsible for caching the source data. Simply put, the secondary server once stores the requested name and address in the cache to speed up access to the requested resource on the Internet, so as not to sort out all possible combinations from the main database in search of an exact match.

Data caching

As already clear, all data is written to be stored in the DNS cache. Do I need to clean it? Indeed, it seems that while saving names and addresses to speed up access to resources on the Internet, deleting such data seems extremely undesirable. However, often a cache overflow can lead to some problems when there are crashes even with an Internet connection.

Clear DNS Cache




In general, the abundance of any temporary files negatively affects the performance of the operating system, but flushing the DNS cache through the command line with the ipconfig / flushdns line allows you to free up space. If we again take the phone book as an example, in a sense, this situation is akin to the fact that phone numbers, addresses, and any other data in it will simply become impossible to write to it due to overflow. Therefore, you’ll have to delete all unnecessary (for example, invalid numbers or the information that you have not used for a very long time).

The concept of domain zones

Now you need to consider another concept related to domain zones. The above examples were considered for only one type of interaction, when only one IP address corresponds to one domain name. But in practice it is very often possible to meet situations when several IP addresses are mapped to the same name of the main resource, which is most often associated with the use of intra-domain names.

The concept of domain zones




That is, a shared resource can include both a mail, an FTP server, and other services. To assign names to absolutely all additional elements, a description of the DNS zone was introduced.

Problems Using IPv4

Why do we need DNS, a little figured out. Now let's try to focus a little on the problems of using the IPv4 protocol. Despite the huge number of possible combinations used to assign a unique IP to each terminal or mobile device, with the current development of such a technique and an increase in the number of its address owners, it was simply not enough for everyone. To eliminate such problems, a new standard of the IP protocol of the sixth version was introduced, but, according to official statistics, it is still very far from its widespread adoption. Therefore, the fact that they began to save on IP addresses in a sense is quite surprising, and therefore several domains can be mapped to the same IP address on the Internet. What is DNS for in this situation?

Ensuring correct DNS-based feedback




Yes, at least in order to provide the correct feedback. For example, on one server several small sites with different domain names can be hosted. But the server itself has one address. The DNS server in this case analyzes the request from the outside and redirects it from the main server to the page that was requested. Accordingly, when responding, the user sees in the browser exactly the resource that he needed, and not some other page.

What function is assigned to the hosts file?

If you describe the basics of DNS functioning in full, you cannot ignore the contents of the hosts file, which is a kind of stumbling block for all Windows-systems (and not only). After all, how does access happen? When entering the address in the browser, it is first checked whether the requested resource is in the list of forbidden ones in this file. If such a record exists, access is simply blocked. However, many viruses use the contents of this file to set redirects to questionable resources. In other words, a line with the redirect IP address and the name of the resource from which you want to redirect, for example, 123.123.123.123 yandex.ru, when you try to access Yandex services, it will transfer you to another IP, which is indicated for the redirect in front of the main name the requested site.

In general, before such a file could contain several thousand lines with both addresses and domain names, acting as the cached content. With the advent of DNS, the need to describe each resource has disappeared.

Hosts file contents




The required computer terminal (127.0.0.1 localhost) is simply indicated as the local host, everything below this line is blocked, and the rest of the resources are open by default for communication. But to be honest, many experts call the hosts file a certain outdated atavism, despite some blocking and allowing functions that still exist.

Configure DNS on local networks

Now a few words about why we need a DNS server on the local network (and whether it is needed at all), because in theory the provider has one and through it it can communicate between the main network, subnets and individual terminals with Internet resources. According to most experts, regardless of whether Internet access is used, such a server is necessary. Why do I need DNS in the LAN? Firstly, its availability greatly simplifies the administration of network terminals, because there can be not five or ten, but from a dozen or more. Secondly, it becomes possible to assign a separate domain name to each network computer (roughly, “Petya”, “Vasya”, “Masha”). Thirdly, IP addresses can be assigned both manually and automatically. Fourth, if there are any restrictions on visiting certain resources (for example, the same social networks) when accessing the Internet, there is no need to add them to the blocking lists of the hosts file on each terminal, but you can register settings exclusively on one server.

Another purpose of DNS is that when using the provider's server, the speed of access to the Internet may decrease, but when installing a separate DNS for the local network there will be no problems with the connection.

Common DNS Settings for Wired and Wireless

For home users using a wired connection based on static addresses, the preferred and alternative DNS server of the provider is usually specified in the IPv4 protocol settings.

IPv4 Wireless Settings




Its settings are also present with a wireless connection, but the local machine receives the DNS and IP addresses automatically, and the basic DNS settings are registered only on the router. By and large, for wireless connections, such automation is one of the main conditions for establishing an Internet connection.

Internet access problems and their solution by changing DNS servers

However, even full automation does not preclude connection failures. In this case, it is often recommended that you change the DNS settings, because there are a huge number of primary servers in which the databases of all registered IP addresses are stored. As an alternative to provider servers, you can specify the parameters of the same free servers from Google, which not only store much more information in the databases, but also provide much greater performance. What is this type of DNS address for? As already clear, the use of such combinations allows not only to restore access to the Internet, but also significantly accelerate it.

Google Free DNS Server Addresses




Just for the sake of interest, you can try to prescribe the settings indicated above yourself and compare the speed of opening pages when using these options with what it was before. Sometimes the difference is huge.




All Articles