DNS (Domain Name System) is the "phone book" of the Internet. The IP address is used as the phone number, and domains are used as contact names. In such a book, you can enter not only the "phone number", but also additional information about the contact ("e-mail", "place of work", etc.).
Domain information is stored on DNS servers. To add it to the DNS system, you need to register resource records. With their help, servers share domain information with other servers. Until the resource records for the domain are registered, it is not in the Internet "phone book". Therefore, the operation of the site or mail on it is impossible. Before you start specifying resource records, you need to delegate the domain, that is, register DNS servers for it. Then go to the resource records. The changes will take effect after the DNS servers are updated (usually up to 24 hours).
The main resource records are A, CNAME, MX, TXT, and SPF records.
The A (address) record is one of the key Internet resource records. It is needed to connect the domain to the IP address of the server. Until an A-record is registered, your site will not work. When you enter the site name in the browser address bar, it is the DNS A record that determines which server to open your site from.
Examples of A record:
The name of the record | Record Type | Meaning |
site.com | A | 123.123.123.123 |
shop.site.com | A | 123.123.123.123 |
where 123.123.123.123 is the IP address of the server you need.
AAAAA (IPv6 address record) is a record that works the same way as the A record — it associates a domain with the IP address of the server. However, it is suitable only for IPv6 addresses (type 7618:0d18:11a3:04d7:1f34:8a2e:07a0:765e).
Examples of AAAA records:
The name of the record | Record Type | Meaning |
www.site.com | AAAA | 2341:fe9a:ed9e:1ee6 |
mail.site.com | AAAA | 7898:0d18:11a3:09d7:1f77:8a2e:01a0:764d |
where is 2341:fe9a:ed9e:1ee6 is the IP address of the server you need.
CNAME (Canonical name) is a record that is responsible for linking subdomains (for example, www.site.com ) to the canonical domain name (site.com ) or another domain. The main function of CNAME is to duplicate domain resource records (A, MX, TXT) for various subdomains.
Examples of CNAME entries:
The name of the record | Record Type | Meaning |
www.site.com | CNAME | site.com |
mail.site.com | CNAME | webmail.hosting.site.com |
If you specify a CNAME for a subdomain www.site.com and specify the value site.com , the site will open from the same IP address as site.com . If you write a CNAME for mail.site.com and specify the value webmail.hosting.site.com Then on mail.site.com the same resource records will be distributed as for webmail.hosting.site.com .
Important
Using a CNAME record excludes the use of other resource records for this subdomain, that is, for a subdomain mail.site.com or www.site.com you cannot add both the A record and the CNAME record at the same time.
The MX record is the record responsible for the server through which the mail will work. MX records are critical for the operation of mail. Thanks to them, the sending party "understands" which server to send mail to for your domain.
Examples of MX records:
The name of the record | Record Type | Priority | Meaning |
site.com | MX | 10 | mx1.site.com |
site.com | MX | 15 | mx2.site.com |
where mx1.site.com — the mail server you need.
Two mail servers are usually specified, so that if one of them is unavailable, the mail will still be sent to the other. The priority of the record determines which server to send mail to first. The lower the number, the higher the priority. Thus, for a domain name site.com mail server mx1.site.com it is the main one, and mx2.site.com acts as a secondary one. If the priority is the same, the server is randomly selected.
TXT (Text string) is a record that contains any textual information about the domain. TXT records are used for various purposes: confirming domain ownership, ensuring email security, and confirming an SSL certificate. It is often used for domain ownership checks when connecting additional services, as well as as a container for recording SPF and the DKIM key. You can register an unlimited number of TXT records, as long as they do not conflict with each other.
The SPF record (Sender Policy Framework) contains information about the list of servers that have the right to send emails on behalf of a given domain. Allows you to avoid unauthorized use. The SPF setting is written in the TXT record for the domain.
Example of an SPF record:
The name of the record | Record Type | Meaning |
site.com | TXT | v=spf1 include:_spf.hosting.com ip4:123.123.123.123 a mx ~all |
where 123.123.123.123 is the IP address of the server you need.
In this example:
In addition to "~" and "-", there are other keys for the "all" parameter:
NS, PTR, and SOA records are service records and are usually configured automatically.
The NS record (Authoritative name server) points to DNS servers that are responsible for storing the rest of the domain's resource records. The number of NS records must strictly correspond to the number of all servers serving it. It is critically important for the DNS service to work.
PTR is a reverse DNS record that associates the IP address of the server with its canonical name (domain). The PTR record is used to filter mail. Reverse DNS records are registered automatically for all virtual hosting servers.
SOA (Start of Authority) is the initial record of the zone, which indicates on which server the reference information about the domain name is stored. It is critically important for the DNS service to work.