Explore WaseerHost

Appearance

GuideDomainsDNS 15 min read

What Are DNS Records? Every Record Type With Examples

DNS records tell the internet where your site and email live. Learn what A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, CAA and SRV records do and how to look them up.

Waqas Ahmed Waseer, authorWaqas Ahmed WaseerFounder & CEO
Updated
What Are DNS Records? Every Record Type With Examples

Summarize with:

Share:

DNS records are the entries in your domain's zone that tell the internet where things live: which server hosts your website, which server takes your email, and who is allowed to send mail or issue SSL certificates for your name. Each record has a name, a type, a value and a TTL. This guide explains what DNS records are, what every common type does (A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, CAA, SRV and wildcards), and how to look each one up yourself.

Key takeaways

  • A DNS record is one line in your domain's zone: a name, a TTL, a type and a value.
  • A and AAAA records point a name at an IPv4 or IPv6 address; CNAME makes a name an alias of another name; MX says where email goes; TXT holds SPF, DKIM, DMARC and verification strings.
  • A CNAME can't share a name with any other record, which is why you can't put a plain CNAME on the bare domain (example.com).
  • PTR (reverse DNS) records live in a separate reverse zone controlled by whoever owns the IP address, usually your host, not in your domain's zone.
  • You can check any record with dig on macOS or Linux, nslookup on Windows, or the free DNS lookup tool.

What are DNS records?

The DNS standard calls them resource records. Each one has an owner name, a type, a class, a TTL and type-specific data (RFC 1035, section 3.2.1). The TTL is the time, in seconds, that the record "may be cached before the source of the information should again be consulted."

Records are stored on your domain's authoritative nameservers. Your registrar points the world at those nameservers, and whatever records they hold are the answers everyone gets. If you're not sure which provider that is, read what nameservers are first: editing records anywhere else has no effect.

Here is one real record, the A record for example.com as returned on 1 October 2026:

text
example.com.    91    IN    A    172.66.147.243

Reading left to right: the name, the remaining TTL in seconds, the class (IN for internet), the type and the value.

DNS record types at a glance

RecordWhat it doesExample valueLook it up
APoints a name to an IPv4 address192.0.2.10dig A example.com
AAAAPoints a name to an IPv6 address2001:db8::10dig AAAA example.com
CNAMEMakes a name an alias of another nameexample.com.dig CNAME www.example.com
MXNames the mail server(s) for a domain10 mail.example.com.dig MX example.com
TXTHolds text: SPF, DKIM, DMARC, verification"v=spf1 mx -all"dig TXT example.com
NSLists the domain's authoritative nameserversns1.example.com.dig NS example.com
SOAZone settings: primary server, contact, serial, timersns1.example.com. hostmaster.example.com. ...dig SOA example.com
PTRMaps an IP address back to a name (reverse DNS)mail.example.com.dig -x 192.0.2.25
CAALists which certificate authorities may issue SSL0 issue "letsencrypt.org"dig CAA example.com
SRVGives the host and port for a named service10 5 5061 sip.example.com.dig SRV _sip._tls.example.com

On Windows, swap dig TYPE name for nslookup -type=TYPE name. Microsoft documents the -type=<resourcerecordtype> option for exactly this (Microsoft Learn).

An example DNS zone

This is what a small business domain's zone could look like in the standard zone-file format. The addresses are example values.

text
$ORIGIN example.com.
$TTL 3600
@              IN  SOA   ns1.example.com. hostmaster.example.com. (
                         2026100101 ; serial
                         7200       ; refresh
                         3600       ; retry
                         1209600    ; expire
                         3600 )     ; minimum (negative-answer TTL)
@              IN  NS    ns1.example.com.
@              IN  NS    ns2.example.net.
ns1            IN  A     192.0.2.53
@              IN  A     192.0.2.10
@              IN  AAAA  2001:db8::10
www            IN  CNAME example.com.
@              IN  MX    10 mail.example.com.
mail           IN  A     192.0.2.25
@              IN  TXT   "v=spf1 mx -all"
s1._domainkey  IN  TXT   "v=DKIM1; k=rsa; p=MIIBIjANBgkqh...IDAQAB"
_dmarc         IN  TXT   "v=DMARC1; p=quarantine; rua=mailto:[email protected]"
@              IN  CAA   0 issue "letsencrypt.org"
_sip._tls      IN  SRV   10 5 5061 sip.example.com.
sip            IN  A     192.0.2.40
*              IN  A     192.0.2.10

@ means the domain itself, and $TTL sets the default TTL for records that don't state one, a directive added by RFC 2308. You rarely type a zone file by hand. Hosting control panels give you a form. cPanel's Zone Editor, for example, manages A, AAAA, CAA, CNAME, MX, SRV and TXT records among others (cPanel Docs). Every WaseerHost plan uses cPanel, so that's where you'd edit them if your domain uses your hosting nameservers (see the shared hosting plans).

IBM Technology's short video walks through how zones and records fit together:

A and AAAA records

An A record maps a name to an IPv4 address. An AAAA record "stores a single IPv6 address", and its IANA type value is 28 (RFC 3596). A host with several addresses has several records, and a name can have both types at once.

bash
dig A example.com +short
dig AAAA example.com +short

On 1 October 2026 example.com returned two of each: 172.66.147.243 and 104.20.23.154 for A, and 2606:4700:10::ac42:93f3 and 2606:4700:10::6814:179a for AAAA. On Windows:

cmd
nslookup -type=AAAA example.com

Only add an AAAA record if your server answers on that IPv6 address. Visitors who connect over IPv6 use it, so a wrong AAAA record can break the site for them even though the A record works.

CNAME records (and the CNAME lookup)

A CNAME says "this name is an alias; the real (canonical) name is over there." Resolvers then look up the target and return its records. The classic use is www pointing at the bare domain, or a subdomain pointing at a hosted service.

To do a CNAME lookup:

bash
dig CNAME www.github.com +short

That returned github.com. on 1 October 2026. On Windows, use nslookup -type=CNAME www.github.com.

The two CNAME rules that trip people up

  1. A CNAME can't sit next to other records. RFC 1034 says: "If a CNAME RR is present at a node, no other data should be present" (RFC 1034, section 3.6.2). RFC 2181 tightens this: an alias name "may have no other data" apart from DNSSEC records (RFC 2181, section 10.1). So blog.example.com can be a CNAME, or it can have A, MX and TXT records, but not both.
  2. No plain CNAME on the bare domain. The zone apex (example.com itself) must hold the SOA and NS records, so a CNAME there breaks rule one. RFC 1912 shows exactly this mistake and warns that the server will "refuse to add any other resources for that name" (RFC 1912, section 2.4). Some providers work around it. Cloudflare's CNAME flattening "allows you to use a CNAME record at your zone apex" by answering with the target's IP addresses instead (Cloudflare Docs). cPanel's ALIAS record does something similar, but cPanel's own docs call it experimental and "not RFC-compliant" and advise against it.

One more rule applies. MX and NS records must point at a real hostname, never at a CNAME. RFC 2181 says that name "must not be an alias" (section 10.3).

MX records

MX records tell other mail servers where to deliver email for your domain. Each has a preference number and a mail server name, and "lower values are preferred" (RFC 1035, section 3.3.9). Two MX records with preferences 10 and 20 mean "try 10 first, fall back to 20."

bash
dig MX google.com +short

That returned 10 smtp.google.com. on 1 October 2026. Try dig MX example.com +short and you get 0 ., a "null MX". RFC 7505 defines this as a way to say a domain accepts no email at all.

If you use Google Workspace or another email provider, they give you the exact MX values to enter. The guide to using Gmail with your own domain walks through it, and WaseerHost email covers mailboxes on your own domain.

TXT records: SPF, DKIM, DMARC and verification (DNS TXT lookup)

A TXT record holds text. RFC 1035 simply says TXT records "are used to hold descriptive text" (section 3.3.14), and other standards define what goes inside. The four you'll meet most:

  • SPF lists which servers may send mail for your domain. It must be a TXT record (RFC 7208, section 3.1) and a domain "MUST NOT have multiple records" that a check would select, so merge senders into one v=spf1 record. A record ending in -all tells receivers to fail anything not listed.
  • DKIM publishes the public key that verifies your mail's signatures. It lives at selector._domainkey.yourdomain; RFC 6376 gives the example of a query for "foo.bar._domainkey.example.com" (section 3.6.2.1).
  • DMARC tells receivers what to do with mail that fails checks. It sits at _dmarc.yourdomain and starts with v=DMARC1; the policy p= is none, quarantine or reject (RFC 7489).
  • Verification strings prove you control a domain to services such as search consoles and email providers. You add the exact string they give you; it does no harm to leave it in place.

To do a DNS TXT lookup:

bash
dig TXT example.com +short
dig TXT _dmarc.google.com +short

On 1 October 2026 the first returned "v=spf1 -all" (no server may send mail as example.com) plus a verification string, and the second returned Google's DMARC policy, "v=DMARC1; p=reject; rua=mailto:[email protected]". On Windows:

cmd
nslookup -type=TXT _dmarc.google.com

NS and SOA records

NS records name the servers that are authoritative for the zone. RFC 1035 defines an NS record as naming "a host which should be authoritative for the specified class and domain" (section 3.3.11). The NS records that count for the outside world are the ones your registrar publishes, which is why you change nameservers at the registrar.

bash
dig NS example.com +short

The SOA record (start of authority) sits at the top of every zone. Its fields, per RFC 1035, section 3.3.13:

FieldMeaning
MNAMEThe primary source nameserver for the zone
RNAMEThe administrator's mailbox, with the @ written as a dot
SERIALVersion number of the zone; secondaries use it to spot changes
REFRESH, RETRY, EXPIREHow often secondary servers check for updates, retry and give up (seconds)
MINIMUMToday, the TTL for "this name doesn't exist" answers

RFC 2308 says a negative answer is cached for the lower of the SOA's own TTL and its MINIMUM value (section 3). If someone looked up a subdomain before you created it, they may keep getting "not found" until that time runs out.

bash
dig SOA example.com +short

On 1 October 2026 that returned elliott.ns.cloudflare.com. dns.cloudflare.com. 2415949263 10000 2400 604800 1800: primary server, contact mailbox [email protected], serial, then refresh, retry, expire and a MINIMUM of 1,800 seconds (30 minutes).

PTR records and reverse DNS

A PTR record maps an IP address back to a name. Reverse lookups use a special tree: the address 10.2.0.52 "is located at domain name 52.0.2.10.IN-ADDR.ARPA" (RFC 1035, section 3.5). IPv6 uses ip6.arpa with one label per hex digit (RFC 3596).

bash
dig -x 8.8.8.8 +short

dig -x builds the in-addr.arpa name and asks for the PTR record for you (BIND 9 manual). It returned dns.google. on 1 October 2026. On Windows, nslookup 8.8.8.8 does the same.

Two things site owners need to know:

  • You can't set a PTR record in your domain's zone. The reverse zone belongs to whoever holds the IP block. Cloudflare's docs tell anyone who doesn't own the prefix to "contact the owner of the IP address based on a whois lookup" (Cloudflare Docs). In practice that's your hosting provider or ISP.
  • It matters for email. Google's sender guidelines say "the public IP address of a sending SMTP server must have a corresponding PTR record that resolves to a hostname", and that the sending IP must match the IP of that hostname (Google Workspace Admin Help). RFC 1912 gives the same advice: "Make sure your PTR and A records match."

CAA records

A CAA record lists the certificate authorities allowed to issue SSL certificates for your domain. Before issuing, a CA "MUST check" for CAA records and must not issue if the request doesn't match them (RFC 8659, section 3). The search climbs the name tree, so a CAA record on example.com also covers its subdomains unless they have their own. The issuewild tag sets separate rules for wildcard certificates, and iodef gives an address for violation reports.

text
example.com.  CAA  0 issue "letsencrypt.org"

That form comes from Let's Encrypt's docs, which also note that with no CAA records "every public CA is allowed to issue certificates" for your domain (Let's Encrypt). Before adding CAA, ask your host which CA issues its free certificates and include it, or renewals will fail.

bash
dig CAA google.com +short

That returned 0 issue "pki.goog" on 1 October 2026.

SRV records

An SRV record tells software which host and port provide a service, in the format _Service._Proto.Name TTL Class SRV Priority Weight Port Target (RFC 2782). Clients "MUST attempt to contact the target host with the lowest-numbered priority", and weight spreads load across targets with the same priority. You usually add SRV records only when a service such as VoIP or a chat system asks for them.

bash
dig SRV _xmpp-server._tcp.jabber.org +short

That returned 30 30 5269 scarlet.jabber.org. on 1 October 2026: priority 30, weight 30, port 5269.

Wildcard DNS records

A wildcard record has * as its leftmost label, for example *.example.com, and answers for names that don't otherwise exist (RFC 4592). The RFC's examples show the rules most people miss:

  1. It only covers names that don't exist. If host1.example exists, a wildcard MX won't answer for it, even if host1 has no MX record of its own.
  2. It can cover deeper names. A query for foo.bar.example gets the wildcard's answer "because bar.example. does not exist, but the wildcard does."
  3. It only covers the types it has. A wildcard with only TXT and MX records gives "no error, but no data" for an A query.
  4. It doesn't cover the bare domain. *.example.com matches names below example.com, not example.com itself.

Wildcards are handy for multi-tenant apps where every customer gets a subdomain. The downside is that typos like wwww.example.com resolve too, so don't add one unless you need it.

How to check your DNS records

With an online tool

The WaseerHost DNS lookup tool shows a domain's A, AAAA, CNAME, MX, TXT, NS and other records in one place. It's the quickest way to confirm a change took effect or to copy records before you move hosts.

With dig (macOS and Linux)

The basic pattern from the BIND manual is dig @server name type (BIND 9 manual). Leave out @server to use your normal resolver, or name a public one to compare answers:

bash
dig MX example.com
dig MX example.com @8.8.8.8 +short
dig +trace example.com

+trace follows the chain from the root servers down to your nameservers, which shows whether the problem is the delegation or the records.

With nslookup (Windows)

cmd
nslookup -type=MX example.com
nslookup -type=TXT example.com 1.1.1.1

The last argument is the DNS server to ask. Microsoft's docs list the error messages too: "Nonexistent domain" means the name doesn't exist, while "No records" means the name exists but has no records of that type.

Why dig ANY doesn't show everything

You might expect dig ANY example.com to list every record. Many servers now return a minimal answer instead, which RFC 8482 allows. On 1 October 2026, an ANY query to Cloudflare's nameserver for example.com returned a single placeholder record reading "RFC8482". Query each type separately, or use the lookup tool.

Changes not showing yet?

Resolvers keep each answer for its TTL, so an edit can take that long to reach everyone. Your own computer caches too; flushing your DNS cache clears it. If a site now shows "DNS_PROBE_FINISHED_NXDOMAIN", the name isn't resolving at all; check the A record for that exact name first.

Frequently asked questions

They're the settings for your domain name. Each record answers one question, such as "what IP address is the website on?" (A), "where does email go?" (MX) or "who may send mail for this domain?" (TXT/SPF). They're stored on your domain's nameservers and cached by resolvers for the record's TTL.

Waqas Ahmed Waseer

Written by

Waqas Ahmed Waseer

Founder & CEO

Founder and CEO of Wasevo LLC, the company that runs WaseerHost. He works on cPanel/WHM servers, WHMCS billing and the Next.js storefront.

Related Guides

Get new guides by email

One short email when we publish something useful. No spam; unsubscribe at any time.

Free SSL · Free migration · 24/7 support

Find your domain

Search domains
30-day money-back guarantee

Renews at the same price for the term you choose