Everything you wanted to know about domains, but hesitated to ask
Domain (more precisely - domain name ) - to simplify greatly, this is the name of your site.
This article title already exists © Google
How is your apartment in the house , so each site is on the server. Each house has its own address, so the server has an address - it is called IP ( internet protocol ) address . These are the same numbers like “126.96.36.199”. They consist of four numbers (each number is from 0 to 255, that is, the smallest address is 0.0.0.0, the largest is 255.255.255.255), if we multiply 256 * 256 * 256 * 256 = 4294967296, then we find out the maximum number of addresses ... There are only a little more than 4 billion of them. It turned out that there are fewer IPs than people, so back in 1996 a new protocol was invented IPv6 , in which (it's not hard to guess from the name), 6 numbers are used and the number of addresses in it will provide the ability to use more than 300 million IP-addresses for each inhabitant of the Earth.
The maximum number in “256” (counting from zero 0-255) is not just chosen so. The fact is that in computers, numbers are stored in binary system , in which the digit 0 or 1 is called bits (unit of information). Every eight bits make up a byte, one byte contains a number from 0 to 255 or 2 ^ 8 = 256, where 2 is the number of possible digits in the numeral system (0, 1), and 8 is the number of digits. Such things :)
Duplicate Wikipedia © Author's quote
So, all servers have an address where our beloved and cozy google, netflix, etc. are located. Now imagine a situation in which you have to write 188.8.131.52 in your browser to visit a website. This is very inconvenient, so they came up with human names for the addresses, for example www.digiants.agency . This domain name consists of three parts - “www”, “digiants”, “agency”, which are separated by periods. Each word is a domain, a phrase in full is a domain name. Information about each domain is stored on DNS ( domain name system ) servers. Each separate DNS server is responsible for its own domain. Consider www.digiants.ua:
- Information about first-level domains (.com, .de, .agency, .ua, etc.) is located on DNS root servers (there are 13 of them in total), and coordinates the first level domains ICANN . So, the address of the DNS server that serves the “ua” domain is located on the root server.
- DNS servers that store information about the .ua subdomains (digiants.ua, something.ua etc) belong to the company hostmaster . Also, this company keeps a single database of all companies that have the right to register the any-word-here.ua domain, here is the list . These companies are called “domain name registrars.”
- Information about domains below the level is held by the domain owners. For example you bought digiants.ua - it means you own it, and the DNS servers of the registrar company indicate the IP address of your DNS server, which means you yourself can set IP addresses to any subdomains (www.digiants.ua, somesite.digiants.ua etc). Here's how to technically transfer a domain to someone.
What the name server does
There is only one for the entire subnet:
Both young and single,
And 20 years old, and with a beard
The server maintains the domains that are delegated to it. That is, it contains information about domains in the format of DNS records. When your browser makes a request to a DNS server, it returns all DNS records (or resource records ).
The main types of resource records:
- A - stores the IPv4 address of the domain.
- AAA - stores the IPv6 address of the domain.
- NS is the address of the DNS server that is responsible for this domain.
- SOA - stores the domain name and cache lifetime (TTL - time to live). Remember, you "bind" a domain to a new hosting and you are told that it will take from 2 to 48 hours. This is precisely because of this recording. After all, in order not to search the Internet for the IP address of a domain every time, the DNS server temporarily remembers (caches) information.
- MX - data about the mail server.
- TXT - any data (for example, for Google Confirmation).
- SRV is the hostname and port name for some services.
That is, to summarize the above, a useful response information from the DNS server would be:
A - 184.108.40.206
How the browser learns the IP address of the domain
Firefox is a great browser, and will forever remain in memory
Let's say you wrote in your browser www.digiants.agency ... First of all, the browser reads the file hosts (this is a file in which the owner of the computer himself can write which IP address corresponds to which domain), if he did not find a match there, then it makes a query to the DNS server (below we will only consider recursive query to the DNS server).
Upon request, it turns out that this server does not know about this domain. Then he turns to root server , he replies: I have no information about the domain www.digiants.agency, but there is an entry that “agency” has such an ip - 212.80 .32.20 (this one and below, IP addresses are not real). Then the server will ask 220.127.116.11 - “you know www.digiants.agency”, he answers - “no, but there is a record that digiants.agency is located at 18.104.22.168“. And at the end, the request is sent to the third DNS server and receives the required IP address (while the DNS server remembers its path for the time specified in the TTL). As a result, the browser gets the IP it needs.
Web 1.0 - the state of the Internet, when it was not yet the same.
- The analogy with a house and an apartment is not correct, since one IP an address (apartment in a server house) can have many domains, but one domain can contain several IP addresses (for load balancing).
- ICANN - not an American, but an independent international organization, you can see them financial report .
- The main participants in the Internet governance process are the Internet Design Working Group, Internet Society, World Wide Web Consortium (W3C), Internet Corporation for Assigned Names and Numbers (ICANN), governments, Internet service providers, registrars. In short, there are thousands of them.
- There are 13 root servers in total, but there are alternative root servers , and Internet architecture advice strongly against them.
- Recursive queries to the DNS server require more load, so they are usually accepted only from a narrow circle of queries (for example, ISPs only allow their clients to make such queries and so on.
- Historically, each first-level domain means something, for example .com (commercial) - for commercial projects, .org (organization) - for non-commercial projects, .net (network) - for companies connected with the network, etc. The full list can be viewed here . Although these names have lost their relevance a little.