Three glass index cards show a globe, an envelope and chain links for website, mail and alias DNS records.
TechVertu » Blog » Infrastructure and Networking » DNS Record Types Explained: A, CNAME, MX and TXT in Practice

DNS Record Types Explained: A, CNAME, MX and TXT in Practice

A DNS record tells a system what information it can find under a domain name. The record type determines what the answer means. A and AAAA give the IPv4 and IPv6 addresses of a host. CNAME makes one name an alias for another. MX names the servers that receive email for a domain. TXT publishes text that a service can use to verify ownership or check an email policy.

Suppose your business is moving its website and keeping its email provider. The hosting company gives you a new IP address. Which DNS entries need attention? The example below follows a single domain from its website to its mail server, so you can see exactly where their records meet and where they are independent.

DNS record types at a glance

Start with the question the application needs answered. A browser looking for an address and a sending mail server looking for a destination can ask about the same domain and receive different, equally correct answers. The IANA registry of DNS record types lists the full set. These ten cover common business tasks.

Ten DNS record types and the question each answers
Record type What it tells you and where to look
A The IPv4 address for a host name. Check the name visitors use, such as the bare domain or www. A host can have several addresses.
AAAA The IPv6 address for a host name. Check it alongside A when a website moves. IPv6-capable visitors may still reach the old host if its AAAA record remains.
CNAME Another DNS name to look up. A common use is to make www follow the addresses of the bare domain. A CNAME contains a name, never a URL or IP address.
MX The host that accepts incoming email for the domain after the @ in an address. A smaller preference number is tried first. The target host needs its own A or AAAA record.
TXT Public text at a particular name. The requesting service defines its meaning. A supplier might request a verification string at the bare domain, while a mail administrator publishes a DMARC policy under _dmarc.
NS The authoritative name servers for a zone. The parent zone delegates to name servers, and the child zone publishes its own NS set at its top-level name, called the zone apex.
SOA The zone’s administrative record. It identifies the primary name server and responsible mailbox, and carries a serial number and timers. A zone has one SOA at its apex.
SRV The server and port for a named service and protocol. Under the SRV specification, clients use priority first and weight to select among targets of equal priority.
CAA Which certificate authorities may issue certificates for a name. An issue entry can authorise a named issuer. The CAA specification also defines how an issuer finds applicable records higher in the DNS tree.
PTR The name associated with an address in reverse DNS. Check it with the provider responsible for the IP range. An ordinary entry in the business’s forward zone cannot set the reverse answer for that address.

TTL means time to live. It is a field on a record that tells a resolver how long it can ordinarily cache the answer, in seconds. Setting a TTL of 3,600 allows up to an hour of ordinary caching. A previously cached answer can have time left under its earlier TTL. Allow for that interval when planning a DNS record change. With DNS filtering, a resolver or security service can allow a lookup, block it or return a different answer according to its policy.

Download the DNS record reference

Keep the one-page reference beside a provider’s setup instructions. It brings together the record types, the names to look up and the cases where an alias or mail target needs a second check.

How to read a DNS zone

A zone is the portion of DNS for which a set of name servers publishes authoritative answers. In a business network, that lookup supplies a name or address. Routers then handle traffic between networks. In a DNS control panel, look for fields such as Name (or Host), Type, Value (or Target) and TTL. An MX form usually has a separate Priority field. The Azure DNS record-set guide shows how entries sharing the same name and type are grouped.

Take @ IN MX 10 mail.alder.example. in a text zone file. The owner @ means the current zone name. IN is the Internet class. MX is the record type, 10 is the preference and mail.alder.example. is the mail server’s full DNS name. The final dot makes the target absolute. Under the DNS zone-file naming rules, an unqualified name is relative to the current origin. A control panel may append the domain automatically or use a blank field for the apex. Check its preview of the final name before saving.

A worked example for a business domain

Alder Studio is fictional. Its domain, alder.example., uses a suffix reserved for examples. The addresses below also come from documentation ranges. This is a zone file you can read from top to bottom. A public lookup will not reproduce it.

$ORIGIN alder.example.
$TTL 3600
@ IN SOA ns1.alder.example. hostmaster.alder.example. (
    2026112601 3600 900 1209600 300 )
@ IN NS ns1.alder.example.
@ IN NS ns2.alder.example.
ns1 IN A 192.0.2.53
ns2 IN A 192.0.2.54

@ IN A 192.0.2.20
@ IN AAAA 2001:db8::20
www IN CNAME alder.example.

@ IN MX 10 mail.alder.example.
mail IN A 192.0.2.25
@ IN TXT "vendor-verification=illustration"
@ IN TXT "v=spf1 ip4:192.0.2.45 -all"

@ IN CAA 0 issue "letsencrypt.org"
_sip._tcp IN SRV 10 0 5060 voice.alder.example.
voice IN A 192.0.2.30

Read the blank-line groups as four different jobs.

  1. Publish the zone. The first group names two authoritative servers and gives them addresses. The SOA names ns1 as primary and encodes the contact [email protected]. The first number in parentheses is the zone serial. If these in-domain servers were delegated for a real domain, the parent would also need address information for them, known as glue, so a resolver could reach them in the first place.
  2. Find the website. The bare domain has IPv4 address 192.0.2.20 and IPv6 address 2001:db8::20. The www alias leads to that same pair. If both names should follow a website move, review the two apex address records. The alias already points to the right name. DNS gets the browser to a host. The cloud application walkthrough explains what happens when it connects.
  3. Deliver and authenticate mail. A server sending to [email protected] looks up the domain’s MX and then the address of mail.alder.example.. It reaches 192.0.2.25. The separate SPF string authorises 192.0.2.45 to send using this envelope domain. The incoming and outgoing addresses can differ. The other TXT string is a fictional verification value. For a real mail provider, use the SPF record examples to account for all legitimate senders before choosing a policy.
  4. Find the issuer and voice service. The CAA value uses the issuer identifier published by Let’s Encrypt. It permits that issuer under the illustrated policy. It does not install a certificate. A SIP client using TCP can look up _sip._tcp.alder.example. to find voice.alder.example. on port 5060. There is a single target, with priority 10 and weight 0.

The PTR sits outside the file. For the mail server, its illustrative reverse entry is 25.2.0.192.in-addr.arpa. IN PTR mail.alder.example.. Read the IPv4 octets in reverse order to find the owner name. The forward A record then maps that host back to the same address. As APNIC explains in its reverse DNS guidance, control follows the address-space delegation. For a hosted mail system, the provider may manage it for you.

Which DNS records can share a name?

An instruction to “add a record” is incomplete until you know the exact name. In Alder’s zone, the apex holds several types of data, while www holds a single alias. The DNS rules for aliases and mail targets explain the difference.

Four proposed DNS changes and their coexistence rules
Proposed change What to check before editing
Add a verification TXT where SPF already exists Two separate TXT values can coexist. Keep the verification token in its own record. The SPF specification permits only one applicable SPF policy at a name. Two records beginning v=spf1 can produce a permanent SPF error.
Add a TXT or A at www, which already has a CNAME A CNAME owner cannot also hold ordinary TXT, A, AAAA or MX data. If the supplier allows a different verification name, use that exact name. Keep the working alias while you confirm the options.
Set a standard CNAME at the bare domain A zone apex must hold SOA and NS data, so it cannot be a standard CNAME. Some hosts offer an apex alias or CNAME flattening that returns addresses. Check the provider’s supported feature and the public A and AAAA answers.
Point MX to www or enter its IP address An ordinary MX target must be a DNS name with a direct A or AAAA record. An IP literal or a target that is itself a CNAME is unsuitable. Compare Alder’s mail target with the separate www alias. The direct-target rule also applies to name servers and ordinary SRV targets.

If an email-security tool reports a policy warning, check the name it queried. SPF at the bare domain and DMARC at _dmarc.alder.example. have different jobs. TechVertu’s DMARC policy troubleshooting guide walks through that second lookup. Reports from receiving systems can then help you interpret SPF and DKIM alignment for mail that was actually sent.

How to check which record needs attention

For a read-only check in Windows PowerShell, use Microsoft’s Resolve-DnsName command with the name and type you want. Replace the fictional names below with your own. These commands need no access to your DNS hosting account.

Resolve-DnsName -Name www.alder.example -Type CNAME -DnsOnly
Resolve-DnsName -Name alder.example -Type A -DnsOnly
Resolve-DnsName -Name alder.example -Type AAAA -DnsOnly
Resolve-DnsName -Name alder.example -Type MX -DnsOnly
Resolve-DnsName -Name mail.alder.example -Type A -DnsOnly

The website moved, but some visitors reach the old host. Follow the alias and query both A and AAAA for its target. If A is current and AAAA still identifies the old host, have the web host confirm the correct IPv6 arrangement. A browser redirect or certificate mismatch after the right address has been reached needs a web-hosting check.

The website works, but incoming mail has stopped. Read the MX preference and target, then check the target’s A or AAAA. In the worked example the two useful answers are 10 mail.alder.example. and 192.0.2.25. If both match the mail provider’s instructions, use the sender’s delivery error and the provider’s mail logs to investigate the next stage.

A supplier cannot see a verification token. Query TXT at the precise name the supplier supplied. Check for a doubled suffix, for example _verify.alder.example.alder.example.. To separate publication from caching, query the delegated authoritative server directly using -Server with its address, then compare with the normal resolver. If authoritative servers disagree, check the others before attributing the difference to caching.

For a live change, the person editing needs permission for the zone at its authoritative DNS host. Record the existing name, type, value and TTL first. Agree the new targets with the service owner, retain the previous working values for rollback and check the application after the DNS answers are correct. A website move in this example needs no MX or SPF change. If the website is moving to a cloud host, include those DNS checks in your migration cutover checklist.

Planning a website or mail move?

Bring the current DNS answers and the new provider’s instructions to the handover. If your team needs help coordinating a hosting or network change, TechVertu’s infrastructure team can help review the services that depend on it.

Frequently asked questions

Subscribe for Latest Tech Insights & Company News

anything else?

Lets Talk!

If you have additional comments or questions about this article, you can share them in this section.

Your email address will not be published. Required fields are marked *


Scroll to Top