DNS Records Explained: A Practical Setup and Troubleshooting Reference
DNSdomainshostingemail authenticationinfrastructure

DNS Records Explained: A Practical Setup and Troubleshooting Reference

FFlorence Cloud Editorial Team
2026-11-28
7 min read

A practical DNS setup guide covering A, CNAME, MX, TXT, NS, SRV, and CAA records, plus migration and troubleshooting checklists.

DNS records connect a domain name to websites, email systems, verification services, and other infrastructure. This practical reference explains what the main record types do, which records each common scenario needs, and how to troubleshoot changes without disrupting an existing service.

Overview

The Domain Name System (DNS) translates names such as example.com into information that browsers, mail servers, and other clients can use. A DNS record has a name, type, value, and often a time to live (TTL). The exact labels in a DNS provider’s dashboard vary, but the underlying concepts are consistent.

Before changing DNS, identify where the domain’s authoritative DNS is managed. This may be the registrar, a hosting platform, a dedicated DNS provider, or a CDN. The provider shown in your domain registration account is not always the provider hosting the active DNS zone. Check the domain’s assigned nameservers first.

Use this pre-change checklist:

  • Record the current DNS entries, especially MX, TXT, and nameserver information.
  • Confirm the exact hostname and destination supplied by your hosting, email, or verification provider.
  • Check whether the provider expects a relative name such as www or a fully qualified name ending in a dot.
  • Lower the TTL before a planned migration if your provider supports it, then allow existing cached responses time to expire.
  • Make one logical change at a time and note the time, value, and reason for each change.

DNS record reference

RecordPurposeTypical useImportant detail
AMaps a hostname to an IPv4 address.Point a domain or subdomain to a server.Use an IPv4 address only.
AAAAMaps a hostname to an IPv6 address.Make a service available over IPv6.Do not put an IPv4 address in an AAAA record.
CNAMEAliases one hostname to another hostname.Connect www or an app subdomain to a hosting platform.A CNAME generally cannot coexist with other records at the same name.
MXSpecifies mail servers for a domain.Receive mail at user@example.com.Each entry has a priority; the target must resolve to an address.
TXTStores text used for policies and verification.SPF, DKIM, DMARC, and service ownership checks.Copy the value exactly, including required punctuation.
NSIdentifies authoritative nameservers.Delegate DNS to a provider or a subdomain.Changing nameservers changes where the active zone is managed.
SRVDescribes a service, port, and host.Applications that discover services by protocol and port.Values commonly include priority, weight, port, and target.
CAAStates which certificate authorities may issue certificates.Restrict certificate issuance for a domain.Coordinate changes with every certificate provider you use.

Checklist by scenario

Publishing a website

  1. Ask the hosting provider whether it requires an A record, AAAA record, CNAME, or a combination.
  2. For the root domain, use the provider’s documented method. A traditional CNAME is not normally placed at the zone apex, although some DNS providers offer CNAME flattening or an equivalent feature.
  3. For www, a CNAME is common when the host gives you a hostname rather than a fixed address.
  4. Configure the alternate hostname deliberately. Decide whether both the root domain and www should work, and set a redirect or canonical hostname at the web server or hosting platform.
  5. Test both HTTP and HTTPS after the DNS change. DNS only directs traffic; the hosting platform must also recognize the hostname and have a valid certificate configured.

When moving a site, keep the old destination available until the new destination responds correctly. A DNS change cannot repair an incorrectly configured virtual host, application, load balancer, or TLS certificate.

Setting up email

  1. Add the email provider’s MX records exactly as documented, including priorities.
  2. Remove obsolete MX records only after confirming that the new service is ready to receive mail. Multiple providers should not be listed casually as a failover plan.
  3. Add the provider’s SPF policy as a TXT record at the domain root, if required. Keep one consolidated SPF policy rather than publishing separate SPF records.
  4. Publish the DKIM TXT record at the selector hostname supplied by the email provider.
  5. Add a DMARC TXT record at _dmarc. Begin with a policy appropriate for your monitoring and rollout stage, and review reports before enforcing a stricter policy.

SPF identifies permitted sending infrastructure, DKIM adds a cryptographic signature to messages, and DMARC defines how receivers should evaluate alignment and reporting. These records improve domain email administration, but they do not replace mailbox security, provider configuration, or operational monitoring.

Adding a subdomain

Choose the record based on what the service supplied. Use an A or AAAA record when you were given an IP address. Use a CNAME when you were given another hostname. For example, status.example.com might point to a status provider with a CNAME, while api.example.com might point to an application server with an A record.

Check whether the service requires a verification TXT record, a particular path, or a specific hostname in addition to DNS. A successful DNS lookup does not necessarily complete service verification.

Delegating DNS or a subdomain

Changing the domain’s nameservers delegates the whole DNS zone to another provider. That provider must already contain the required records before the delegation is changed. For a subdomain delegation, add NS records for the child name and configure the child zone at the delegated provider. This is different from adding an A or CNAME record for the subdomain.

What to double-check

Names, formatting, and record conflicts

Many DNS dashboards append the domain automatically. Entering www.example.com in a field that expects only a host label can produce an unintended name such as www.example.com.example.com. Read the provider’s field hint and inspect the resulting fully qualified name.

A CNAME at a hostname generally cannot coexist with A, AAAA, MX, or TXT records at that same hostname. The root domain can have several record types, but provider-specific restrictions may apply. Check for duplicate or stale entries before adding a new one.

TTL and propagation

TTL tells recursive resolvers how long they may cache an answer. A lower TTL can make a planned change easier to roll out, while a higher TTL can reduce repeated lookups. TTL is not a switch that forces every resolver to refresh immediately. Cached answers, negative caching, local networks, and application behavior can make results appear inconsistent for a period of time.

Test from more than one network or use independent DNS lookup tools. Query the authoritative nameserver as well as a recursive resolver so you can distinguish an incorrect zone from a cached response.

Email authentication details

Do not copy a provider’s DKIM or SPF value into the wrong hostname. DKIM commonly uses a selector, while SPF is usually published at the domain root. DMARC belongs at _dmarc.example.com. Long TXT values may be displayed in segments by DNS tools; that does not necessarily mean the record is wrong, but the provider’s required value must remain intact.

Review every system that sends mail for the domain, including transactional applications, support platforms, marketing tools, and office mail. An incomplete SPF policy or unconfigured DKIM selector can affect only some messages, making the problem harder to spot.

CAA and certificates

If you use CAA records, verify that the certificate authority used by each website, CDN, or hosting service is permitted. A restrictive CAA policy can prevent certificate issuance even when A or CNAME records are correct. Treat CAA changes as part of certificate management, not as a general website DNS change.

Common mistakes

  • Editing the wrong DNS provider: The dashboard you opened may not host the zone used by the domain. Confirm authoritative nameservers.
  • Replacing all records during a website setup: Website records do not replace MX, TXT, verification, or service records. Export or document the zone first.
  • Using an IP address as a CNAME target: CNAME targets are hostnames. Use an A or AAAA record for an address.
  • Adding multiple SPF records: Publish one SPF policy and update it as sending services change.
  • Assuming DNS controls redirects: DNS points a name to infrastructure. Redirects, URL paths, headers, and application behavior belong to the web server or platform.
  • Testing only from one device: A local cache can conceal a correct change or make an old value look current.
  • Deleting old records too soon: During migrations, old mail or web traffic may still reach the previous service while caches expire.

When to revisit

Return to this checklist before connecting a new domain, migrating hosting, changing email providers, adding a SaaS subdomain, or investigating an outage. Revisit the zone after changes to application infrastructure, certificate management, or mail-sending services as well.

For a planned migration, create a short change record containing the original value, replacement value, TTL, owner, and rollback plan. After the change, verify authoritative answers, recursive answers, website responses, certificate status, and email delivery separately. If a DNS provider, hosting platform, or email service changes its required records, update your documented zone and remove only entries that are confirmed to be obsolete.

Keep DNS changes as deliberate infrastructure work: identify the authoritative source, change the smallest necessary set of records, allow for caching, and validate each dependent service. This approach makes DNS troubleshooting more predictable and reduces the chance that a routine setup change becomes a website or email outage.

Related Topics

#DNS#domains#hosting#email authentication#infrastructure
F

Florence Cloud Editorial Team

Technical Editorial Team

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.