DNS Records Explained: A Practical Guide to A, AAAA, CNAME, MX, TXT, and SRV Records
DNS recordsdomain setupemail DNSCNAMEMX recordsTXT records

DNS Records Explained: A Practical Guide to A, AAAA, CNAME, MX, TXT, and SRV Records

WWebsiteHost Online Editorial Team
2026-11-13
8 min read

Learn which DNS records connect websites, email, subdomains, and services—and how to monitor and troubleshoot them over time.

DNS records are the instructions that connect a domain to a website, mailbox, verification service, or other online system. This practical DNS setup guide explains what A, AAAA, CNAME, MX, TXT, and SRV records do, how to enter them, what to monitor, and when to revisit your settings after a hosting, email, or service change.

Overview

The Domain Name System, or DNS, translates human-readable names such as example.com into the destinations that browsers, mail servers, and applications use. Your domain registrar, web host, DNS provider, or website platform may provide the dashboard where these records are managed. The labels differ between providers, but the underlying fields are usually similar: type, name or host, value or target, priority, and TTL.

DNS is separate from domain registration and web hosting. Registration gives you control of a domain name; hosting stores your website; DNS tells visitors and services where to find the right systems. That distinction matters when you buy a domain and hosting from different companies or move a site without moving email.

Before changing anything, record the existing DNS zone or export it if your provider supports that option. Make one intentional change at a time, save the previous value, and note the date and reason. This simple change log makes troubleshooting and rollback much easier.

RecordPrimary purposeTypical nameTypical value or fieldsCommon starting TTL
APoints a hostname to an IPv4 address@ or a subdomainAn IPv4 address, such as 192.0.2.10300–3600 seconds
AAAAPoints a hostname to an IPv6 address@ or a subdomainAn IPv6 address300–3600 seconds
CNAMEAliases one hostname to another hostnameA subdomain such as wwwA destination hostname, such as target.example.net300–3600 seconds
MXSpecifies where incoming email should be deliveredUsually @Mail server hostname plus priority300–3600 seconds
TXTStores verification or policy text@ or a specified service labelA provider-issued text string300–3600 seconds
SRVIdentifies a service endpoint and portOften _service._protocolPriority, weight, port, and target hostname300–3600 seconds

TTL means time to live: how long resolvers may cache an answer before checking again. A shorter TTL can make planned changes easier to test, while a longer TTL can reduce repeated DNS queries. TTL does not guarantee that every network will update immediately because caches and provider behavior vary.

What to track

A and AAAA records: connecting the website

An A record connects a hostname to an IPv4 address. An AAAA record does the same for IPv6. Your hosting provider should supply the correct address. Do not copy an example address from a tutorial or assume that an A record can accept a hostname; it must contain an IPv4 address. Likewise, use AAAA only when your host provides a valid IPv6 address and the site is configured to serve traffic over IPv6.

The root domain may appear in a dashboard as @, a blank field, or the full domain name. The www version is commonly configured with a CNAME pointing to the root domain or to a host-provided target. Follow your provider’s exact instructions, especially when using a platform that requires several records.

CNAME records: adding aliases and subdomains

A CNAME makes one hostname an alias of another hostname. For example, blog could point to sites.provider.example. Enter the target as a hostname, usually without an http:// or https:// prefix. Many DNS systems do not allow a CNAME at the root of a zone when other records are required there, although some providers offer a provider-specific alternative such as an ALIAS or flattened CNAME. Use the host’s documented method rather than adding conflicting records.

MX records: routing email

MX records tell sending mail servers which systems accept email for your domain. An MX entry contains a mail server hostname and a priority number; lower numbers generally indicate preference when multiple entries exist. Enter the exact hostnames supplied by your email provider and preserve the requested priority order.

Remove obsolete MX records only after confirming that no active mailbox or forwarding service depends on them. Multiple unrelated MX records can send messages to the wrong system or produce inconsistent delivery. An MX target should point to a hostname, not directly to an IP address.

TXT records: verification and email authentication

TXT records are used for domain ownership checks and policies. A service may ask you to place a token at the root, or at a label such as _acme-challenge. Copy the value exactly, including punctuation and capitalization where relevant. Some dashboards add quotation marks automatically; others ask you to enter them. Follow the dashboard’s format and avoid adding extra spaces.

Email providers may also ask for SPF, DKIM, and DMARC-related TXT records. SPF commonly identifies permitted sending systems, DKIM publishes a public key under a selector such as selector._domainkey, and DMARC publishes a policy under _dmarc. Treat provider-generated values as authoritative, and avoid publishing multiple separate SPF records for the same domain. Change email authentication policies carefully and monitor delivery after each change.

SRV records: service discovery

SRV records are used by services that need a hostname, port, and preference information. A typical entry includes a name such as _service._tcp, priority, weight, port, and target. The exact syntax varies, so use the service’s supplied values instead of guessing. SRV records are less common for ordinary websites but may be required by communication, gaming, or other specialized applications.

Cadence and checkpoints

DNS does not need daily maintenance, but it deserves a deliberate review each quarter and whenever infrastructure changes. Keep a simple inventory with the hostname, record type, value, purpose, provider, TTL, date checked, and person responsible. This turns an opaque DNS zone into an understandable operating record.

Workflow: connect a domain to web hosting

  1. Confirm whether the host requires A records, AAAA records, CNAME records, or a combination.
  2. Lower the relevant TTL ahead of a planned migration if your provider recommends doing so.
  3. Add or update the root and www records using the host’s exact values.
  4. Check that no old records conflict with the new configuration.
  5. Verify both the root domain and key subdomains, then test HTTPS after the host confirms the domain.
  6. Restore a longer TTL if appropriate and keep the old values in your change log until the transition is complete.

For a broader move, use the Website Migration Checklist alongside your DNS notes. Changing DNS alone does not move website files, databases, mailboxes, or SSL configuration.

Workflow: configure email

  1. List every mailbox, forwarding address, and sending application that uses the domain.
  2. Enter the email provider’s MX records and priorities.
  3. Add the requested SPF and DKIM records, checking for existing records that must be edited rather than duplicated.
  4. Add a DMARC record according to a policy your organization can manage and monitor.
  5. Send test messages in both directions and inspect whether authentication results are passing.

If email problems appear after a hosting change, review the DNS Troubleshooting Guide before changing records at random.

Workflow: add a service or subdomain

First identify the exact hostname the service wants you to use. Add a CNAME when the destination is a hostname, an A or AAAA record when the destination is an IP address, or a TXT record when the service requests verification. Confirm ownership in the service dashboard only after the record is saved. Keep a note of whether the provider expects the full hostname or only the label, because entering app.example.com in a field that automatically appends the domain can create an incorrect name.

How to interpret changes

A successful DNS change may not appear everywhere at once. Check the authoritative DNS provider first, then test from more than one network or use a DNS lookup tool. If one location shows the new value and another shows the old value, caching may be involved. If every lookup shows the old value, check nameservers, spelling, record type, and whether you edited the active DNS zone.

Website symptoms can help narrow the cause:

  • The root domain fails but www works: inspect the root A or AAAA records and any provider-specific root-domain setting.
  • www fails but the root works: check the CNAME or separate address record for www.
  • The website works but email does not: review MX records first, then SPF, DKIM, and DMARC configuration.
  • A verification service cannot find its token: check the exact host label, TXT value, and active nameservers.
  • Only some visitors see an error: compare IPv4 and IPv6 behavior, cached results, and whether an outdated record remains.

Do not delete unfamiliar records merely because you do not recognize them. They may support email, a subdomain, a certificate challenge, analytics, payments, or another active service. Identify the owner and purpose first. If you are choosing new infrastructure, compare the operational details in the Best Web Hosting for Small Business guide, not just the advertised storage or bandwidth.

When to revisit

Review your DNS inventory quarterly, before a domain renewal, and before launching a major website or email change. Recheck it immediately after changing registrars, nameservers, hosts, email providers, website platforms, CDN settings, or security services. A monthly review is sensible for a business that frequently adds tools, subdomains, or sending systems.

Use this checklist at each review:

  1. Confirm that the listed nameservers are still the ones you intend to use.
  2. Compare active records with your inventory and remove only records with a confirmed owner and purpose.
  3. Test the root domain, www, important subdomains, and representative email addresses.
  4. Check that MX priorities, SPF authorization, DKIM selectors, and DMARC settings still match your email services.
  5. Review low TTLs left over from past migrations and adjust them when there is no longer a reason to keep them short.
  6. Update the change log with the date, reason, result, and rollback value.

DNS is easy to neglect because it often works quietly for long periods. A short recurring audit prevents forgotten services, conflicting records, and avoidable downtime. Keep this guide with your domain and hosting records, and revisit it whenever you connect a new website, mailbox, subdomain, or third-party tool.

Related Topics

#DNS records#domain setup#email DNS#CNAME#MX records#TXT records
W

WebsiteHost Online Editorial Team

Senior SEO Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.