The DNS server is returning incorrect names. DNS - what is it, why is it needed, how to use it

And you probably noticed that on the way to implementing such an idea there are concepts that you have never even heard of before.

For example, you might have a question: what is DNS? I think you have come across a similar abbreviation, but not many people know what it means.

Domain Name System

So, in fact, the meaning of the DNS abbreviation can be deciphered very simply - Domain Name s System. It may sound incomprehensible, but it only seems so. And, by the way, every Internet user encounters this system many times a day.

We are accustomed to the website address being written in the form of a set of letters that are very easy to read, for example: google.com or mail.ru. These letter addresses work precisely because of the domain name system. For the addresses of Internet nodes, a special digital encoding is used, the so-called IP addresses, and the task of the DNS is to associate the names of Internet sites in letter form with IP in the form of numbers.

The primary task of the Domain Names System is to simplify searches on the Internet necessary resources. For example, to access a website search engine google, we usually enter google.com in the address bar, but you can also use the IP address by writing 194.122.81.53.

As you can see, everything is quite simple, but the letter display of the address is much easier to remember.

It should also be said that the Domain Names System has its own tree structure. Its nodes are called domains, each of which can contain many “subordinate” domains. The structure is usually divided into levels. The system starts with root domain(zero level). There are domains general purpose(COM, NET, ORG, etc.), and two-letter country codes (ru, ua, kz, etc.).

Let's look at an example to make it more clear. First level domains are com, org, ru and the like. Below them is the second level - rambler.ru, google.com; and third-level domains look like this: banner.org.ru, shops.com.ua, etc.

Your website and DNS

When you create your own website or blog (no matter what type of resource), you will definitely come across such concepts as, and of course dns. If this is not the first time you’ve read my blog, then you know that hosting is the territory where your web resource is located, and the domain is its name (or address).

Correct DNS settings for a personal website are very important point. If the data was entered incorrectly, this may result in the website not working at all.

When DNS is configured, it’s as if you inform everyone Global network about where to look for your web resource. If you changed your hosting provider and did not change the information in your domain record, then all the pointers will send users to that server where it has not been there for a long time, that is, to “nowhere”.


If you do everything correctly, there shouldn't be any problems. For dummies, I’ll give you a little parting word. When moving your website to another hosting, you will need to change the administrative panel domain management DNS server data. If you don't know how to find your DNS details, contact your ISP.

How does it all work?

I think you have already understood that dns converts letters into numbers (names into ip). When you enter a website name in address bar, a DNS request is generated to the name server. As a result, the IP address of the resource we want to go to is determined. That is, symbolic designations are needed only for the convenience of people, and computers use IP addresses to communicate on the Internet.

There are two types of name servers: those that store all the information about domain zone, and those that respond to DNS queries for network users. The latter save responses in a cache so that the next such request occurs much faster. Thanks to caching, the number of requests for information is reduced.

I think now the abbreviation dns does not scare you. Tell your friends about it via social networks, let them also read this material and find out what the domain name system is.

Subscribe to blog updates to receive the newsletter and be the first to know about the revision of a new article, see you soon!

Sincerely! Abdullin Ruslan

When talking about securing your internet connection or accessing blocked content in your geographic area, you've probably heard about DNS. Despite the fact that all providers supply their own DNS server by default, you can use alternative DNS server. The DNS service is used to determine the IP addresses of websites by their domain. Everything is very simple - in fact, on the Internet there are no letter addresses like a website, all communications and messages between computers are carried out via IP address. So, to determine an IP address from a domain name, DNS servers are used, which store a huge table of correspondence between domain names and IP addresses.

Using an alternative DNS server provides several benefits:

  • The closer you are to the DNS server, the faster name resolution will be.
  • If DNS provider are not very reliable, an alternative DNS will improve stability.
  • You will get rid of restrictions on access to content based on geographic location.

If these reasons, or at least one of them, interest you, it's time to set up a DNS server on your system. In this article we will talk about how to set up a DNS server in Linux, how to find out its speed, and also look at the best DNS servers. You can choose the best one depending on your needs.

Setting up DNS on Linux

Since our site is still about LInux, let’s look at how to set up DNS servers on Linux. DNS Settings servers in any Linux distribution are located in the /etc/resolv.conf file. The DNS server address is specified in the following format:

nameserver 192.168.137.1

Here 192.168.137.1 is the DNS server address. But the setting in this file will only work until you reboot, since this file is regenerated every time the system boots.

If you use NetworkManager, you can configure the DNS server there, in the connection properties. Open Settings network connections, click in context menu change for required connection then on the IPv4 tab, specify the desired DNS server:

Now the settings are saved even after a reboot.

You can test the speed of the DNS server using the nsloockup utility. For example:

time nslookup www.google.com 208.67.222.222

Server: 208.67.222.222

Address: 208.67.222.222#53

Non-authoritative answer:
Name: www.google.com
Address: 173.194.113.209
Name: www.google.com
Address: 173.194.113.212
Name: www.google.com
Address: 173.194.113.210
Name: www.google.com
Address: 173.194.113.211
Name: www.google.com
Address: 173.194.113.208
real 0m0.073s
user 0m0.012s
sys0m0.004s

The first parameter is the address of the site that we will measure, the second is the DNS server address. The time command measures the execution time of nslookup in milliseconds. Now let's move directly to the list of good DNS servers.

Best DNS servers

1. Google Public DNS

The first DNS server on our list is a server from Google - Google Public DNS. It has been operating since December 2009 and its goal is to make users' Internet experience faster, safer and more convenient. Currently, it is the largest government DNS structure in the world. For using Google Public DNS is enough to use the IP address of the DNS server 8.8.8.8 or 8.8.4.4.

Switching to Google Public DNS improves security and optimizes speed because Google actually uses Anycast routing to find the nearest server. In addition, it is resistant to DNS attacks Cache, as well as DoS.

2.OpenDNS

If you're looking for an advanced version that will give you more control than just a replacement for regular DNS, try OpenDNS. As this company says, you will take another step towards security by implementing this service. There are two options for OpenDNS - home and corporate. Home version comes with parental control, phishing protection and improved speed. The enterprise version of OpenDNS has full functionality to protect the enterprise network. For home use you can get OpenDNS for free. To configure dns Linux servers just install the following DNS addresses: 208.67.222.222 and 208.67.220.220. OpenDNS also supports Anycast.

3. DNS.WATCH

DNS.WATCH is a minimalistic DNS service which allows you to have fast access to the Internet without censorship. Since this service is built on freedom principles, you can be sure that your request will reach its target and no redirects will be used. The server works fast and stable. If you live in a censored country, this will be a great solution. Service DNS servers: 82.200.69.80 and 84.200.70.40.

4. Norton ConnectSafe

Norton ConnectSafe is another DNS service designed for enhanced protection your internet. It should be noted that Norton has been involved in the security aspects of many devices for a long time. So you can be confident in the quality of Norton ConnectSafe. The service offers three various options protection: protection from malware, phishing and scams, protection against pornography and security, and protection against pornography and other threats. For each type of protection, different IP addresses are used. To protect all home network, you just need to configure the router.

5. Level3 DNS

Level3 DNS is a great DNS service if you are looking for a reliable DNS server with excellent performance. While Level3 isn't as big as Google, it has an impressive infrastructure. You can be sure that the speed will be at top level. DNS server IP addresses: 209.244.0.3, 209.244.0.4, 4.2.2.1, 4.2.2.2, 4.2.2.3 and 4.2.2.4.

6. Comodo Secure DNS

Comodo Secure DNS is another service that combines speed, reliability and security. Comodo uses huge network, which includes a large number of DNS servers. Speed ​​will be optimized by selecting a server based on your location. In addition, Comodo takes care of security by supplying a list of dangerous sites, and the DNS service will make sure that you do not visit any of them. Comodo Secure DNS IP addresses: 8.26.56.26 and 8.20.247.20.

7.OpenNIC DNS

Although OpenNIC DNS is last on the list, it is a great solution if you need free access to the Internet, without censorship imposed by the authorities. OpenNIC DNS has a very large network infrastructure and therefore will most likely find a DNS server that is close to your physical location. Just choose required server from the list .

conclusions

As you can see, some of these servers provide regular DNS, bypassing ISP restrictions, while others have additional features- protection against attacks, phishing and dangerous programs. All this - best dns servers and you can choose one of them depending on your needs.

So, here you go DNS is one of the fundamental things on which the entire Internet is built. This abbreviation stands for Domain Name System, which means domain system names.

I already touched on this issue (the structure of the domain name system) when I talked about it, but only in passing. Today I want to talk about the role of DNS servers in the operation of websites and the Internet as a whole.

Why do we need DNS servers and what are they?

The domain name system operates with full names (Latin letters, numbers, dashes and underscores are allowed when forming them)..120.169.66 is not very informative) and it is easier to operate with them.

The latter applies specifically to human factor, because it is still more convenient for machines to use IP addresses, which is what they do... But he understands that this Domain name, which means information about what IP the site is located on, it will be able to receive from the DNS server.

It is on these DNS servers (sometimes they are also called N.S. from the Name Server, i.e. server names) and the entire Internet is supported (like a flat world on three whales standing on a turtle). which does not require direct human participation in its work (if you set it up, it works 24/7). And there are a lot of such DNS servers on the network.

How does DNS work and what does the Hosts file have to do with it?

At the dawn of the Internet, DNS didn't exist at all. But how did the network work then? .120.169.66? The so-called was responsible for this matter then (and now too), where all the hosts of the then small Internet were registered.

Such a file was (and is now) on every user’s computer (yours has it too) connected to the network (see the link above for how to find it).

IN Hosts file several thousand lines were written (according to the number of sites on the Internet at that time), in each of which the IP address was first written, and then the corresponding domain, separated by a space. This is what an entry for my blog would have looked like if it had existed on the Internet twenty-five to thirty years ago:

109.120.169.! See you soon on the pages of the blog site

Send

Cool

Link

Stammer

Collections on the topic:



What are domains, hosting, DNS servers and IP addresses

Infobox - cloud virtual servers VPS on Virtuozzo Parallels

480 auto

If you ask the average Internet user what a website is, most likely he will name, for example, yandex.ru, mail.ru, google.com, facebook.com, ...

In a practical sense, this is quite enough: I found an interesting site, told my friends its domain name (or more simply, “address”).

However, the domain name is not a real address. Well, this is about the same as sending a letter with the inscription on the envelope: “city of Yekaterinburg, to Peter Ivanov.” The point here is not even that there may be several Petrov Ivanovs in Yekaterinburg (let’s imagine that there is only one person with that name). The problem is that the addressee can move, at least, around the city, and handing him a letter will be extremely problematic.

But letters are delivered and received! - Yes, sure. Because they send by postal addresses. For example, “city of Leningrad, 3rd Stroiteley Street, building 25, apartment 12.”

A postal address on the Internet is an IP address consisting of four numbers from 0 to 255, for example, 74.125.131.100. This is one of the IP addresses of the google.com website. If you enter these numbers in the address bar of your browser, you will find yourself on the google.com portal, or more precisely, on google.ru, where you will be automatically redirected.

Why “one of the addresses” and what types of IP addresses there are, we will leave aside for now.

On the Internet, the IP address determines which computer the data should be delivered to.

Does the IP address remind you of anything? - It reminds me of a long mobile phone number.

Phone book

Unfortunately, remembering long phone numbers is not easy. We include them in our notebooks(“contacts”, in mobile phone) and add clear names to them, for example,

Peter Ivanov, +7-343-123-45-67.

In the future we will not need to remember phone number Peter, it’s enough that this number is recorded in our phone book. When we need to call Peter, we will find him in our contacts list without even looking at his number.

On the Internet, the role of a phone book plays domain name system(DNS, Domain Name System). It stores the relationship between the relatively easy-to-remember site name and its hard-to-remember numeric address.

True, there is one significant difference between this “Internet book” and a telephone book. - It is not led by every acquaintance of Peter Ivanov individually, but by himself.

In a private phone book you can write: “Petya”, “Peter”, “Petrusha”, “Petrukha”, “Petrunya”, “beloved”, ..., and in the “Internet telephone book” entries are kept by the site owners themselves, for example:

Domain name Address
pyotr-ivanov.ru123.123.123.123

If someone wants to visit the website of Peter Ivanov, in the address bar of the browser he will type: pyotr-ivanov.ru, and the domain name system will tell the browser (more precisely, the computer on which the browser is running) the corresponding IP address, in our example: 123.123 .123.123. The computer located at this address will process the browser request and send it data to display the requested website page.




Now do you understand how domain names are used? - However, it has not yet been said where records of connections between domain names of sites and the IP addresses of the computers on which these sites are located are stored.

DNS server

He is the one who serves phone book. It stores information about which IP address a particular domain name corresponds to. There are a lot of DNS servers on the Internet. They have a dual role:

  • main - “Internet phone book”;
  • additional (but also important) is caching records of other DNS servers.

First, a few words about caching. Finding out the connection between a site's name and its IP address is required every time you access that website. If the site you want to visit is quite far away, multiple queries to a distant primary DNS server can take a long time and slow down the loading of web pages. To avoid delays, the DNS server closest to your computer (usually located at your Internet service provider) stores information about previously requested IP addresses, and when you access the same site again, it will report its address very quickly, since it will store it in your cache.

But in order to cache something, you need to have a source of what is being cached. Such a source is primary DNS servers, which store the initial relationships between domains and their IP addresses.

To register a domain name, you just need to come up with one. But in order for it to start working, you must tell the registrar the domain name of the DNS server, which will store detailed data about the domain you are registering. These data will be discussed a little later.

Typically, two DNS servers are used: primary and secondary. But there may be more. A larger number of DNS servers increases the reliability of access to your domain: if one is unavailable, another will respond.

IN real world two is quite enough.




Many domain name registrars and Internet providers offer the use of their DNS servers as a paid service.

Every year everything appears on the Internet large quantity sites and not always their owners are professional IT specialists. Therefore, if any site breakdowns occur (and no matter how much you would like to avoid them, they happen from time to time), its owner simply does not understand what is happening. Moreover, they often do not even have basic concept about DNS, which is actually not as difficult as it seems. To better understand the structure of your project, let's look at DNS - one of the fundamentals Internet project.

IN general outline You can understand what DNS means by deciphering its name - Domain Name System. This system serves to distribute a variety of data and keys to them over the Internet. When a user enters a specific key, for example, a website address, the server responds with data corresponding to the requested key. Thus, Internet users can access a huge number of servers around the world.

Basics

In order to better understand what a DNS server does, it will be useful to refer to it in practice. Luckily, the DNS server is public and we can do this easily. Let's take the address of any site directly from the browser link and use the dig command (you can do this from command line operating system macOS x). It will give us information about our request: we requested a record, and the program gave us a single answer.


The answer looks like this:

;; ANSWER SECTION: website. 119 IN A 158.251.3.118

It says that the site with the name we entered is located on one specific IP address, written in the form of four numbers. The number 300 in front of it is the lifetime. It means that given value You can keep it in the cache for 300 seconds before checking it again. And the last part in this line - IN - is the designation of the Internet network.

The rest of the program's response contains information about the server's response time, its IP address, port, request completion time, and the number of bytes contained in the response.

The procedure carried out by us is performed by the browser tens and hundreds of times with each user request to the site. Moreover, it is also carried out for external resources, such as images and scripts. Since each resource requires at least one such request, a large amount of traffic would be consumed if not for large amounts of caching.

In fact, the traffic volumes for each request are much greater than in our example. This is because our example does not show that the DNS server contacted a huge number of other servers to determine the site's address.

If we were to output the entire chain done by the dig command to find the server address, we would get a lot more information output. It is presented in the form of a hierarchy. This is important because with the development of the Internet, there are more and more countries and companies serving DNS servers, and each of them has many machines that have the same IP address.

Other types

There are other types as well. For example – MX, used to connect a domain name to mail servers. Email, due to its importance, has a separate type of DNS record.

The second very famous type is CNAME or, in Russian, canonical name. It is used to link multiple names together.

Disadvantages of CNAME

Main problem of this type records is the inability to create a record of any type with a particular name if it is already occupied by a CNAME record: neither MX, nor NS, nor A. This is because all records referenced by the CNAME are also valid for the CNAME.

Common problems

Most often, developers encounter typical situations, which perhaps, with knowledge of what DNS is needed for, you can handle.

Domain redirect to www

If you need to change the domain from, for example, website to www.site, then excellent helpers For such a redirect, the registrars Namecheap or DNSimple will be used. Now, if we use the dig command again and look at information about the location of the site we need, in place of its address there will be an IP address belonging to Namecheap. At this address there is a server that redirects users to the site with www.

Bottom line

For a website owner, understanding the essence of DNS servers can be quite important and useful for administering your project and troubleshooting DNS-related problems.