Alviy

DNS records explained

Every time you open a website by its name, your device asks DNS: "what is the IP address of this domain?". The answer is provided by the resource records of the DNS zone — short lines, each of which stores a single fact about the domain: a server address, a mail route, proof of ownership and so on. Let's go through the main record types you will run into when setting up any website.

Example DNS zone records: A, AAAA, CNAME, MX, TXT

In your Alviy dashboard the zone is edited through a convenient editor: just pick the record type, enter a name and a value. Below is a cheat sheet that helps you understand what each record is responsible for.

A and AAAA — server addresses

The A and AAAA records are the foundation of DNS. They link a domain name to the IP address of the server that hosts the site. The only difference is the protocol version: A points to an IPv4 address (for example, 93.184.216.34), while AAAA points to an IPv6 address (for example, 2606:2800:220:1:248:1893:25c8:1946). A single domain can have several A and AAAA records at once — this is how load is spread across servers.

CNAME — aliases

The CNAME (canonical name) record makes one domain an alias of another. For example, you can make www.example.com an alias of example.com, and then both names will lead to the same site. CNAME is handy when the target address may change: you edit it in one place and all aliases pick up the change automatically. An important limitation: CNAME cannot be placed on the root of a domain (where the NS and SOA records already live), and it cannot coexist with other records of the same name.

MX — mail servers

The MX (mail exchanger) records specify which servers accept mail for the domain. Each MX record has a priority — a number where lower means more important. Mail first goes to the server with the lowest priority, and if it is unavailable — to the next one. This is how resilient mail delivery is achieved.

TXT — free-form text, SPF, DKIM and DMARC

The TXT record stores arbitrary text information. Most often it is used to protect email and to verify ownership of a domain:

  • SPF — a list of servers that are allowed to send mail on behalf of the domain. Helps to fight sender spoofing.
  • DKIM — a cryptographic signature of messages, confirming that a message was really sent from your domain and has not been altered.
  • DMARC is a policy for mail that fails the SPF and DKIM checks: deliver it, send it to spam or reject it. It is published as a TXT record on the name _dmarc and also brings you reports on who sends mail in your name.
  • Verification — services (search engines, mail, payment systems) often ask you to add a TXT record with a unique value to make sure the domain belongs to you.

NS and SOA — zone management

The NS (name server) records define which DNS servers are responsible for the domain. These are exactly what you specify at the registrar when you delegate a domain to Alviy. The SOA (start of authority) record is a service record; it holds the zone parameters: the primary server, the administrator's e-mail, the zone serial number and refresh timers for secondary servers. These two records are created automatically and form the "skeleton" of any DNS zone.

SRV, CAA and PTR — less common records

Not every zone needs these, but when one of them is involved, things are hard to understand without knowing what it does.

  • SRV says on which host and port a particular service runs. The record name is built from the service and the protocol, for example _sip._tcp.example.com, and the value holds a priority, a weight, a port and a target name. Telephony, directory services and some corporate messengers find their servers this way.
  • CAA lists the certificate authorities that may issue certificates for the domain. It does not affect how the site works, but nobody else can get a certificate for it. If you add CAA and later change your certificate provider, update the record as well, or the new certificate will not be issued.
  • PTR answers the reverse question: which name belongs to this address. It lives in a special zone of whoever owns the address, not in your zone, so you set it up through your hosting provider. Mail servers need it most: without a correct reverse record, messages tend to end up in spam.

TTL — how quickly changes take effect

Every record has a TTL (time to live) — the time in seconds for which the answer is cached on intermediate DNS servers. Until the TTL expires, changes to a record are not visible to some of the users. That is why, before migrating a site, the TTL is lowered in advance (for example, to 300 seconds) so that the switch happens almost instantly, and afterwards it is raised back to reduce the load.

Type Purpose Example value
AIPv4 address93.184.216.34
AAAAIPv6 address2606:2800:220:1::1946
CNAMEDomain aliasexample.com
MXMail server10 mail.example.com
TXTText: SPF, DKIM, DMARC, verificationv=spf1 include:_spf.example.com ~all
NSDomain's DNS serversns1.alviy.com
SOAZone parametersns1.alviy.com admin.example.com …
SRVHost and port of a service10 5 5060 sip.example.com
CAAWho may issue certificates0 issue "letsencrypt.org"

Typical record sets

In practice records come in combinations, and a few of them cover most cases.

Website only. An A record on the bare domain and a CNAME for www pointing to it. If the site goes through proxying, the A record holds the address of the filtering network, and your server's real address stays hidden.

Website and mail. Add an MX on the bare domain, an A record for the mail server's name, a TXT with SPF on the bare domain, a TXT with DKIM on the name your mail service gives you and a TXT with DMARC on _dmarc. This is the set most often lost when a zone moves: the site opens, mail stops, and nobody links it to the move straight away.

Home server or camera. A separate name with a low TTL that a client on the router keeps up to date. The rest of the zone is unaffected: dynamic DNS is an ordinary A record that simply changes more often.

Most common mistakes

  • A CNAME on the bare domain. The standard forbids it and the zone editor will not accept it. Use an address in an A record or an ALIAS-type record if your operator has one.
  • Two SPF records. They appear when a second mail service is connected and one more line is simply added. Merge everything into a single record.
  • An MX pointing to an IP address. The MX value must be a name that has its own A record.
  • TXT and MX lost in a move. Move the whole zone, not only what the website needs.
  • A high TTL before planned work. Lower it a day in advance, or the switch will drag on for a day.
  • Records for services nobody uses any more. An old A record pointing to a server that is switched off, or an abandoned subdomain, is clutter and also a hint for anyone studying your infrastructure.

Now that you know what each record is for, you can easily configure a domain for your needs — from a simple website to a full-featured mail infrastructure. You can manage all records in one place in Alviy DNS hosting, and when migrating a zone from another operator the editor will automatically find the existing records.