// DevOps
DNS Records: A Guide from A to ALIAS
Published on 2026-09-22
DNS (Domain Name System) — a distributed system that tells, by domain name, where a website is located, where to deliver mail, and who owns the domain. Each such response is stored in the domain zone as a record of a specific type. This article is a reference for record types. How to configure DNS for a website and mail step by step is covered in the series “Configuring DNS for mail and website”: basic A and MX records, SPF, DKIM and DMARC, setup and checking, BIMI.
Two principles: TTL and delegation
TTL — record time-to-live in cache
Each record has a TTL — the number of seconds resolvers and clients may cache the response before asking again.
| TTL | Pros | Cons |
|---|---|---|
| Low (300 s, 5 min) | changes propagate quickly | more queries to DNS servers |
| High (86 400 s, 1 day) | fewer queries, responses are stable | changes apply slowly |
For stable records (A, MX) TTL is usually set from an hour to a day. Before a migration, lower TTL in advance: see the “TTL during migration” section below.
Delegation and NS servers
The parent zone (for example, .ru or .com) delegates control of your zone example.ru to the servers listed in NS records. There must be at least two servers, preferably in different networks: this is required by RFC 2182 and the rules of most registrars. If one server stops responding, resolvers will query another.
Basic records
| Record | What it does | Example |
|---|---|---|
| A | name → IPv4 address | example.ru. A 192.0.2.1 |
| AAAA | name → IPv6 address | example.ru. AAAA 2001:db8::1 |
| CNAME | alias: name points to another name | blog.example.ru. CNAME hosting.example.net. |
| MX | domain mail server and its priority | example.ru. MX 10 mx.yandex.net. |
A name with a CNAME cannot have other records (RFC 1034, RFC 2181). Therefore a CNAME cannot be placed at the zone apex (example.ru): there are always SOA and NS records there.
Service records
NS — servers responsible for the zone
NS records exist in two places: at the registrar (in the parent zone, which is the delegation) and in the zone itself. They must match — a mismatch causes some resolvers to receive stale responses.
SOA — zone parameters
One per zone, describes the primary server, the responsible contact, and timers for secondary servers.
example.ru. IN SOA ns1.example.ru. admin.example.ru. (
2025111101 ; Serial (YYYYMMDDNN)
7200 ; Refresh — how often secondary servers check the zone
3600 ; Retry — retry on failure
1209600 ; Expire — when a secondary server stops answering without contact with the primary
86400 ; Minimum — negative response TTL (RFC 2308)
)Increment the serial number with each zone change, otherwise secondary servers will not pick up the update. The format YYYYMMDDNN (date and edit number for the day) is convenient but not mandatory. In cloud DNS providers the SOA is usually managed by the provider.
TXT — arbitrary text
Used for SPF, DKIM, DMARC and domain ownership verification:
example.ru. TXT "v=spf1 mx include:_spf.yandex.net -all"
example.ru. TXT "yandex-verification=abc123"
_dmarc.example.ru. TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.ru"Details about mail records — in part 2 of the DNS series.
CAA — who is allowed to issue certificates
The record restricts the list of certificate authorities that may issue a TLS certificate for the domain (RFC 8659):
example.ru. CAA 0 issue "letsencrypt.org"If there are no CAA records, any CA may issue a certificate. About free certificate authorities — in the article “Beyond Let’s Encrypt”, about issuing via DNS — in “SSL certificates via DNS”.
PTR — reverse record
Maps an IP address to a name. It is stored in the in-addr.arpa zone (for IPv4) and is configured by the address owner — usually the hosting provider, not the domain zone. PTR is mandatory for a mail server: without it emails often go to spam.
SRV — service host and port
SRV indicates which host and port a service runs on:
_minecraft._tcp.play.example.ru. IN SRV 10 5 25565 mc.example.ru.| Field | Meaning |
|---|---|
10 | priority (lower is more preferred) |
5 | weight for load distribution among servers with the same priority |
25565 | port |
mc.example.ru. | host |
SRV is used by SIP, XMPP, Kerberos, LDAP in Active Directory and some games.
ALIAS (ANAME) and CNAME at the zone apex
The CNAME limitation is inconvenient when the zone apex must point to a platform name (for example, to the address of a cloud provider’s load balancer). DNS providers solve this in their own ways: they resolve the target name themselves and return ready A/AAAA records to the client.
| Provider | What it’s called |
|---|---|
| DNSimple, several others | ALIAS or ANAME |
| Cloudflare | CNAME flattening — CNAME at the zone apex is supported |
| AWS Route 53 | Alias — to AWS resources or to another record in the same zone |
This is not a standard record type from the RFCs, but a provider-specific feature: when moving to another DNS provider it will need to be reconfigured.
GeoDNS — a technology, not a record type
GeoDNS returns different answers depending on where the query came from: for example, users from Europe get a European server address, users from Asia get an Asian one. Location is determined by the resolver’s IP or by the client’s subnet if the resolver forwards it (EDNS Client Subnet, RFC 7871). Such routing is offered by CDNs and DNS providers, for example Route 53 (geolocation routing).
Other records
| Record | Purpose |
|---|---|
| DS / DNSKEY | DNSSEC: chain of trust from the parent zone and signing keys |
| NAPTR | address rewriting rules, used in telephony (SIP, ENUM) |
| HTTPS / SVCB | connection parameters to a service (e.g., HTTP/3 support) before establishing a connection, RFC 9460 |
How to check records
dig NS example.ru +trace # delegation from the root to your NS
dig A example.ru # website address
dig MX example.ru # mail servers
dig TXT example.ru # SPF and verifications
dig TXT _dmarc.example.ru # DMARC
dig SOA example.ru # zone parameters, serial number
dig CAA example.ru # allowed certificate authorities
dig -x 192.0.2.1 # PTR for the address
dig example.ru +dnssec # DNSSEC signaturesTo query a specific server rather than the resolver’s cache, specify it explicitly: dig A example.ru @ns1.example.ru.
TTL during migration
- Two days before (or at least the current TTL) lower the TTL of the records being moved to 300 seconds.
- Wait for the old TTL to expire: only after that will all resolvers start querying frequently.
- Change the records.
- Once everything is verified, restore the TTL to an hour or a day.
Summary
For a website and mail, most companies only need A/AAAA, MX, TXT (SPF, DKIM, DMARC), NS and CAA. SRV, ALIAS and GeoDNS are required for specific tasks: services on non-standard ports, the zone apex on a cloud platform, or traffic distribution by region.
Sources:
- RFC 1034 and RFC 1035 — DNS basics
- RFC 2181 — clarifications, including about CNAME
- RFC 2182 — selection of secondary DNS servers
- RFC 8659 — CAA
- RFC 9460 — SVCB and HTTPS
- Cloudflare: CNAME flattening
- AWS Route 53: alias records
// Reviews
Related reviews
I came with an expensive request to configure a VPS server, but during the consultation Mikhail suggested a much simpler, more affordable solution. In the end I saved time and money. Mikhail — a true expert who works for the client's result, not for the fee. I recommend him!
I came with an expensive request to configure a VPS server, but during the consultation Mikhail suggested a much simpler and more cost-effective solution. In the end I saved budget and time. Mikhail — a true expert who …
VPS setup, server setup
2026-05-12 · ★ 5/5
Excellent work! Set up the server very quickly, installed the control panel, and configured the IP. Definitely recommend!
Excellent work! Very quickly set up the server, installed the panel, configured the IP I can definitely recommend it!
Everything was excellent; helped promptly and professionally. Thank you — I recommend them to the community.
Everything's great, helped promptly and professionally, thank you, I recommend it to the community
VPS setup, server setup
2026-04-16 · ★ 5/5
There were several issues concerning both the technical side and overall understanding. Mikhail responded quickly, resolved the technical problems, and helped me understand them — many thanks. I'm satisfied with the result.
There were several issues concerning both the technical side and overall understanding. Mikhail responded quickly to the request, helped sort things out and resolved the technical problems and helped clarify …
VPS setup, server setup
2026-02-18 · ★ 5/5
Everything was done quickly and efficiently. I recommend.
Everything was done quickly and efficiently. I recommend.
VPS setup, server setup
2026-01-17 · ★ 5/5
Everything went well; the contractor responded quickly to questions and helped resolve the issue. Thanks!
Everything went well, the contractor responded quickly to questions and helped resolve the issue. Thank you!
VPS setup, server setup
2025-12-16 · ★ 5/5
// Contact
Need help?
Get in touch with me and I'll help solve the problem
I reply within one business day (03:00-13:00 GMT)
Или оставьте заявку здесь:
// Related