Skip to content
Current coupon:10% offUse it in your order

DNS records explained: A, AAAA, CNAME, SRV, TXT, MX and PTR

How DNS works, what each record type does, what TTL is and why a change takes a while, how to check a record with nslookup or dig, and which mistakes to avoid.

  • beginner
  • ~15 min
  • Updated 1 Oct 2026

DNS turns names like example.cz into the IP addresses computers understand. This article explains what each record type does, why a change doesn't take effect right away and how to check a record yourself. The guides on a domain for your VPS and a domain for your Minecraft server build on these basics.

What you'll need

  • Your own domain (with any registrar), or just the wish to understand how DNS works
  • Access to your domain's DNS record management
  • A computer with Windows, macOS or Linux to check records
  • About 15 minutes

How DNS works#

When a player types mc.example.cz into Minecraft, or a visitor types example.cz into a browser, their computer asks a resolver (their internet provider's DNS server, or a public one such as 1.1.1.1). The resolver looks up which authoritative DNS server holds the domain's records, asks it, and stores the answer for a while.

Three roles that often get mixed up:

RoleWhat it doesExample
RegistrarWhere you bought the domain and pay for it. It sets which nameservers manage the domain.The company you have your .cz or .com domain with.
DNS hosting (nameservers)The server that stores the domain's records (A, MX …). This is where you edit records.Often the registrar itself, or Cloudflare.
ResolverLooks up answers for users and caches them.Your internet provider's DNS, 1.1.1.1, 8.8.8.8.

Edit records where the nameservers point

If your domain uses Cloudflare's nameservers, the records at your registrar aren't used at all, even if you can see them there. First find out where your DNS actually runs (the command for the NS record is below).

Record types#

TypeWhat it's forExample valueWatch out for
AMaps a name to an IPv4 address.203.0.113.10Only one record per name, unless you want the addresses to rotate.
AAAAMaps a name to an IPv6 address.2001:db8::10If the service doesn't listen on IPv6, clients with IPv6 won't connect.
CNAMEThe name is an alias for another name.example.cz.Can't be at the domain root or next to another record with the same name.
SRVWhere (name and port) a specific service runs.0 5 25570 mc.example.cz.The target must be a name with an A/AAAA record, not an IP address and not a CNAME.
MXWhere the domain's email is delivered.10 mail.example.cz.The target must have an A/AAAA record; it can't be a CNAME or an IP.
TXTAny text: domain verification, SPF, DKIM, DMARC."v=spf1 mx -all"A domain can have only one SPF record.
NSWhich nameservers manage the domain.ns1.example.net.Change it only when moving your DNS elsewhere.
CAAWhich certificate authorities may issue a certificate.0 issue "letsencrypt.org"If you set CAA, don't forget to allow the authority you use.
PTRMaps an IP address to a name (reverse DNS).mail.example.cz.It's set by the owner of the IP address, not by you in your domain. See rDNS.

A and AAAA#

The foundation of everything: they say which IP address a name points to. You'll find your VPS's IPv4 address in the customer area in the Network tab (for example 203.0.113.10), and the IPv6 address there too (for example 2001:db8::10).

Add an AAAA record only if the service behind the name really listens on the IPv6 address. Devices with IPv6 usually try IPv6 first.

CNAME#

A CNAME says “this name is just another name for that name”. Typically www.example.cz as an alias for example.cz. The resolver then looks up the A/AAAA record of the target name.

Rules:

  • A name with a CNAME can't have any other record (per the DNS standard, RFC 1034). That's why a CNAME can't be placed at the domain root (example.cz), where there are always NS and SOA records.
  • Some DNS providers work around this with their own feature (Cloudflare calls it CNAME flattening): at the root they return the target's IP address directly.

SRV#

An SRV record says which name and port a specific service runs on. Minecraft Java Edition uses it, for example: thanks to it, players don't have to type the port.

text
_minecraft._tcp.mc.example.cz.  300  IN  SRV  0 5 25570 mc.example.cz.
PartMeaning
_minecraftThe service name, always with an underscore.
_tcpThe protocol, always with an underscore.
mc.example.cz.The name the record applies to (what the player types into the game).
300TTL in seconds.
0Priority – the client tries the target with the lowest priority first.
5Weight – the ratio of weights decides between targets with the same priority. With a single target it doesn't matter.
25570The port the service actually runs on.
mc.example.cz.The target – a name with an A/AAAA record holding the server's IP address.

In a DNS provider's web interface the fields have similar names (Name / Service / Protocol, Priority, Weight, Port, Target). The full procedure for Minecraft is in Server address and custom domain. Bedrock Edition doesn't use SRV records.

MX and TXT#

  • MX sets the domain's mail server. The lower number (priority) wins. The target must be a name with an A/AAAA record.
  • TXT carries text. Services such as Google or Microsoft use it to verify that you own the domain. Email uses it for SPF (who may send mail for the domain), DKIM (message signing) and DMARC (what to do with forged messages, the _dmarc.example.cz record).

Domain root and subdomains#

  • The root (also the “apex”, @) is the domain itself, example.cz.
  • A subdomain is anything in front of it: www.example.cz, mc.example.cz, panel.example.cz. You don't have to “create” a subdomain anywhere; just add a record for it.
  • An asterisk (*.example.cz) is a wildcard record for all names that don't have their own record.

Type only the first part in the Name field

Most DNS web interfaces append the domain to the name for you. For mc.example.cz, type only mc in the Name (Host) field, and @ for the root. If you type the full mc.example.cz, you'll end up with an unwanted mc.example.cz.example.cz.

A trailing dot (example.cz.) in zone file notation means “the full name, don't add anything”. In web interfaces you usually don't need to type it; if the interface requires the dot, it will tell you.

TTL and “propagation”#

TTL (time to live) is the number of seconds resolvers may remember an answer. When you change a record, a resolver that currently remembers it keeps returning the old value until its TTL expires. This is what's commonly called “DNS propagation”.

TTLWhen to use it
300 (5 minutes)You're planning a change (moving a server) or still fine-tuning.
3600 (1 hour)Normal operation, nothing is changing.
86400 (1 day)Records that don't change for years.

Moving without downtime

The day before you move a server, lower the record's TTL to 300. After the move, the new IP address spreads within 5 minutes. Once everything works, you can raise the TTL again.

Two more situations:

  • Changing nameservers at the registrar takes longer, usually up to 24 hours.
  • Negative answers are remembered too. If someone asks for a name before the record exists, the resolver remembers “no such name” for a while. So create the record first and only then test it.

How to check a record#

Replace example.cz and mc.example.cz in the commands with your own domain.

Windows

Open PowerShell (or Windows Terminal) and use nslookup:

PowerShell
nslookup example.cz
nslookup -type=AAAA example.cz
nslookup -type=SRV _minecraft._tcp.mc.example.cz
nslookup -type=NS example.cz
nslookup example.cz 1.1.1.1
  • nslookup example.cz – asks the default DNS server for the name's addresses.
  • -type=AAAA – the record type you're asking for (A, AAAA, SRV, MX, TXT, NS, CNAME).
  • 1.1.1.1 at the end – asks a specific resolver instead of the default one. Useful when you want to bypass your provider's cache.
Outputtext
Server:  one.one.one.one
Address:  1.1.1.1

Non-authoritative answer:
Name:    example.cz
Address:  203.0.113.10

Non-authoritative answer is fine: the answer came from a resolver, not directly from the domain's nameserver.

In PowerShell you can also use Resolve-DnsName:

PowerShell
Resolve-DnsName -Name example.cz -Type A -Server 1.1.1.1
  • -Name – the name you're looking up.
  • -Type – the record type.
  • -Server – the resolver you're asking (optional).

macOS

Open the Terminal app. The dig program comes preinstalled on macOS:

bash
dig +noall +answer example.cz A
dig +noall +answer example.cz AAAA
dig +noall +answer _minecraft._tcp.mc.example.cz SRV
dig +short example.cz NS
dig @1.1.1.1 +short example.cz A
  • dig – a tool for DNS queries.
  • +noall +answer – prints only the answer section, without the technical details.
  • +short – prints only the value itself.
  • example.cz A – the name and record type.
  • @1.1.1.1 – asks a specific resolver.
Outputtext
example.cz.		300	IN	A	203.0.113.10

The columns are: name, remaining TTL in seconds, class (always IN), record type and value.

Linux

On Ubuntu 24.04 and Debian 13 (for example right on your VPS), install the package with the dig program if the system doesn't have it:

bash
apt update && apt install bind9-dnsutils
  • apt update – downloads the current package list. Without it, apt install can fail with Unable to locate package.
  • && – runs the second command only if the first one finished without an error.
  • apt install – installs a package from the system repositories. Run it as root; as a regular user, put sudo in front of both commands.
  • bind9-dnsutils – the package with the dig and nslookup tools.

Then use the same commands as on macOS:

bash
dig +noall +answer example.cz A
dig +noall +answer _minecraft._tcp.mc.example.cz SRV
dig +short example.cz NS
dig @1.1.1.1 +short example.cz A
  • +noall +answer – only the answer section.
  • +short – only the value.
  • @1.1.1.1 – a query to a specific resolver.

Useful public resolvers for checking: 1.1.1.1 (Cloudflare), 8.8.8.8 (Google), 9.9.9.9 (Quad9). If the new record shows up there but not for you, you have an old answer in your cache.

Advanced: asking the domain's nameserver directly

The cache doesn't affect the answer from the authoritative nameserver. Find the domain's nameserver and ask it directly. Replace ns1.example.net with one of the nameservers from the first output:

bash
dig +short example.cz NS
dig @ns1.example.net +short mc.example.cz A

If the record is there but not elsewhere, just wait for the TTL to expire. dig +trace example.cz shows the whole path from the root servers.

Common mistakes#

MistakeWhat happensFix
The full domain in the Name fieldYou get mc.example.cz.example.cz and the address doesn't work.Type only mc in the Name field.
Two different A records for one nameSometimes you connect, sometimes you don't.Keep only the record with the right IP.
A forgotten AAAA record pointing to the old serverThe website or server doesn't work from IPv6 networks (mobile data).Point the AAAA record to the new IPv6, or delete it.
A CNAME next to another recordThe DNS provider rejects the record, or it behaves unpredictably.Use either a CNAME or A/AAAA for a name, not both.
The SRV or MX target is an IP addressThe client can't find the address.The target must be a name with an A/AAAA record.
Cloudflare proxy (orange cloud) for a game server or SSHThe website works, but the game and SSH don't.Set these records to DNS only (gray cloud). See domain on a VPS and Cloudflare.
Editing records at the registrar while NS points elsewhereThe change never takes effect.Edit the records where NS points.
A record in the hosts file on your computerThe name leads somewhere else for you than for everyone else.Check the hosts file (Windows C:\Windows\System32\drivers\etc\hosts, macOS and Linux /etc/hosts).

Troubleshooting#

Non-existent domain (Windows) or NXDOMAIN (dig)#

The name doesn't exist. Check for typos, that the record is saved and that you're editing it with the right nameservers. If you asked for the name before you created the record, wait a few minutes (a negative answer in the cache).

The answer is empty, but the name exists (No answer, ANSWER: 0)#

The name exists, but it has no record of the type you're asking for. For example, you have an A record but are asking for AAAA. Each tool shows it a little differently:

  • dig +short prints nothing. The full dig output shows status: NOERROR and ANSWER: 0.
  • nslookup on macOS and Linux prints *** Can't find …: No answer.
  • nslookup on Windows prints only details about the domain's nameserver instead of an address (the primary name server line).

For SRV, check that the name contains _minecraft._tcp. and the right subdomain.

1.1.1.1 shows the new IP, but I still get the old one#

Your computer or internet provider has an old answer in its cache. Wait for the TTL to expire, or clear your computer's cache:

Windows

PowerShell
ipconfig /flushdns
  • ipconfig /flushdns – clears the DNS cache in Windows (including remembered negative answers).

macOS

bash
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • sudo – runs the command with administrator rights (it asks for your Mac password; nothing is shown as you type).
  • dscacheutil -flushcache – clears the system's directory service cache.
  • ; – runs the second command after the first one.
  • killall -HUP mDNSResponder – signals the system DNS service to drop its cache.

Linux

bash
sudo resolvectl flush-caches
  • sudo – runs the command with administrator rights. Leave it out on a VPS where you're signed in as root.
  • resolvectl flush-caches – clears the cache of the systemd-resolved service, which Ubuntu and many other distributions use.

If the command fails (for example with resolvectl: command not found), the system doesn't use systemd-resolved. That's the case with a standard Debian installation, for example: the system doesn't cache DNS answers itself and there's nothing to clear.

Browsers have their own cache; closing and reopening them helps.

dig: command not found or nslookup: command not found#

On Linux, install the bind9-dnsutils package (see the Linux tab above). On Windows, use nslookup or Resolve-DnsName instead of dig.

The change hasn't taken effect even after several hours#

  1. Find the domain's nameservers: dig +short example.cz NS (Windows: nslookup -type=NS example.cz).
  2. Check that you're editing the records with the same provider the NS points to.
  3. Ask the nameserver directly (see “Advanced” above). If the record isn't there, the change wasn't saved.

Summary

  • A and AAAA point a name to an IP address, CNAME to another name, SRV gives a service's name and port, MX routes email.
  • You edit records with the DNS provider the domain's nameservers point to, not necessarily at your registrar.
  • TTL sets how long resolvers remember the old value; lower it to 300 s before a change.
  • A CNAME doesn't belong at the domain root, and an SRV/MX target must be a name, not an IP.
  • Check a record with nslookup (Windows) or dig (macOS, Linux).

Search the guides