What is DNS?
DNS stands for Domain Name System. It is a system of servers that run the DNS management system and help translate domain names into IP addresses and vice versa. To get a basic understanding of what we’re talking about, you can think of a phone number and the owner’s name. The phone number here would represent the IP address. Than the owner’s name would be the domain. Since the server operates on a network at some IP address that you would have to remember, this system was created to translate individual server IP addresses into domain names and vice versa.
For example, let’s take alza.cz, an internet store name that almost everyone knows today. This website runs on a server with the IP address of 22.214.171.124. So, each time you shop at Alza, you would have to enter the IP address 126.96.36.199 into your browser, which you would also have to remember. The same would apply to Google, Facebook, Seznam… there are a lot of IP addresses that wouldn’t mean anything to anyone, and people would likely have an equivalent of something like yellow pages at home, listing IP addresses and their corresponding websites.
This is why DNS was created, to do all of this for you. You enter the domain into your browser, and it can translate this domain name into the IP address 188.8.131.52, and based on that IP address, it can easily find the target server.
How DNS works
DNS works on a system of queries. Let’s go back to the domain alza.cz as an example. You enter it into your browser, which first finds out where the CZ top-level DNS servers are (via the root DNS servers, represented by a dot). Your computer then asks the CZ top-level DNS servers if they know where the alza.cz domain has its web hosting (or the server where the website is running). The root DNS servers do not have this information, but they know which DNS servers are authoritative for the alza.cz domain. They return this information to your computer.
The browser then continues the search and asks the authoritative DNS servers for the alza.cz domain if they have the information on where this domain’s web server is located. These DNS servers have the necessary information and retrieve the IP address of the server for the domain, which they return to the browser.
At this point, the browser knows the IP address of the server and sends a request to that server to see if it has any content for the alza.cz domain. So, the server does have content, which it returns to the browser, and the website is displayed for you to begin browsing or shopping.
The most commonly used types of records
The most commonly used types of records include:
- A record and AAAA record
- Cname record
- MX record
- TXT record
A record and AAAA record
This type of record is fundamental and used for translating domain names into IP addresses. Specifically, it uses either an IPv4 or IPv6 address. In IPv4, the address typically consists of 4 blocks of digits separated by dots. An IPv4 address looks like this, for example – 184.108.40.206. However, due to the increasing number of combinations required for more and more IP addresses, a new format was introduced – IPv6. IPv6 includes letters and colons and allows for a vast number of possible combinations. An IPv6 address looks like this – 2001:15e8:107:1:ffff:ffff:ffff:d22.
Cname is used for redirecting a subdomain to a domain’s text record. It is most commonly used to redirect the subdomain www. To ensure that the domain works with both www and without it, the domain without www is redirected to the IP address using the A or AAAA record. The subdomain www then uses the Cname record, which doesn’t redirect to an IP address but directly to the domain name. In practice, a request to the domain with www is redirected to the domain without www, and then the IP address is used to connect to the destination server.
MX stands for Mail Exchange, and as the name suggests, the MX record is used for routing emails. When you send an email to someone, the system needs to know which server to deliver it to – where the recipient’s mailbox is located. In the MX record, you should use only the hostname of the server, not the IP address. For example, mx.example.com. Additionally, unlike other types of DNS records, the MX record specifies a priority, which is a numerical value. This priority is used when there are multiple MX records in the DNS. It determines which server is primary and which are secondary or backup servers. The lower the priority number, the more important the server is. For instance:
- Priority 0 – Primary
- Priority 5 – Secondary
- Priority 10 – Tertiary
It’s essential to note that an MX record can only be assigned to a domain name and not an IP address. The MX record is used by the sending mail server to locate the receiving mail server and deliver the email message. The receiving mail server is specified in the MX record as a domain name and not an IP address. So the MX record also helps in determining the email routing, especially when the mail servers are not located on the same network or domain
A TXT record is typically used for various types of verifications. For example, with a TXT record, you can verify that you are the owner of a domain for Google services. Google generates a code for you, which you then insert into the DNS as a TXT record. Google will then see it through the DNS and assumes that only the owner or administrator of the domain has access to the DNS. This verifies that you are the owner.
Another type of record can be SPF, which verifies the IP address of the SMTP server for sent emails. In SPF, you have a range or a list of IP addresses from which the email can be sent to be considered valid. If a spammer spoofs your email address and sends a fake email from a different server, the recipient’s server will detect that the IP addresses of both servers do not match, and such an email is usually immediately discarded as spam.
Other possible uses of TXT records include DMARC, DKIM, and many others.
What is DNS – Conclusion
This simplified description of the Domain Name System only serves to provide an idea of how DNS works and the basic DNS records used for various purposes. If you have any questions, feel free to use the comments section below.
Je mi líto, že pro Vás nebyl článek užitečný.
Jak mohu vylepšit článek?
Řekněte mi, jak jej mohu zlepšit.