Skip to content
IT glossary
DevOps and cloudUpdated December 3, 2026

DNS records

DNS-записи

These are entries in the Domain Name System. They tell software which IP address belongs to a hostname, which hostname an alias points to, or which servers accept email for a domain.

Also known as: A-запись, CNAME

What a DNS record tells you

A DNS lookup asks for a name and a type of information. An A query for www.example.com asks for an IPv4 address. An MX query for example.com asks where to deliver its email. Those are separate lookups, and changing one record doesn't automatically change the other.

How records are published and cached

A record has an owner name (the name it applies to), a type, a value in the format defined by that type, and a time to live (TTL) in seconds. It also has a class, usually IN for Internet DNS. Authoritative name servers publish records for a zone. Most clients use a recursive resolver, which answers from its cache when possible and otherwise follows DNS referrals to find the authoritative answer. The TTL tells the resolver how long it can normally reuse a cached answer before looking it up again.

Common record types include:

  • A / AAAA: return IPv4 / IPv6 addresses. One name can have multiple address records.
  • CNAME: makes one name an alias of another. An address lookup follows the alias to find the target's address records.
  • MX: lists mail servers by hostname. A lower preference number is tried first.
  • TXT: carries text, such as a domain verification token or an SPF policy.
  • NS: names the authoritative servers for a zone and is used to delegate it.

Example: pointing a website at a hosted service

Suppose a hosting provider gives you site.hosting.example.net as the target for your website. Your zone could contain these entries:

example.com.      300 IN A     192.0.2.10
www.example.com.  300 IN CNAME site.hosting.example.net.

The bare domain uses a fixed IPv4 address. For www, the resolver looks up the hosting provider's name, so the provider can change the underlying addresses without asking you to edit your zone. The browser still requests www.example.com: the host must be configured to serve that name, and its TLS certificate must cover it. If you want visitors to see a different URL, configure an HTTP redirect instead.

Common interview questions

Why can't you put an ordinary CNAME at the zone apex? The apex is the zone's own name, example.com in this example. It already has mandatory SOA and NS records, which can't coexist with a CNAME at the same name. Some DNS providers offer alias-style features at the apex that return address records rather than publishing a CNAME there.

Why do some users still reach the old server after an address change? Their recursive resolvers may still have the previous answer cached. Use dig to compare the answer from an authoritative server with the answer from the resolver those users rely on. Before a planned cutover, lower the TTL far enough in advance for answers cached under the old TTL to expire. Lowering it at the moment of the switch won't shorten the lifetime of answers already in caches.