DNS Records for Website Hosting: A Practical Guide to A, CNAME, MX, TXT, and Nameservers
DNSdomain managementwebsite hostingemail hostingnameservers

DNS Records for Website Hosting: A Practical Guide to A, CNAME, MX, TXT, and Nameservers

TTopShop Cloud Editorial Team
2026-11-20
8 min read

Learn which DNS records connect your domain to hosting, email, and third-party services—and how to change them safely.

DNS determines where a domain sends visitors, email, and verification requests. This practical guide explains the main DNS records for website hosting, when to use A records versus CNAME records, how MX and TXT records support email, and how to change nameservers safely. Use it when launching a site, connecting a subdomain, migrating hosting, or reviewing your domain settings before making a production change.

Overview

The Domain Name System, or DNS, translates human-readable domain names into the services that handle them. When someone visits example.com, DNS helps their device find the server hosting the website. It can also direct mail for [email protected], confirm ownership of a domain, or specify which certificate authorities may issue certificates for the domain.

DNS is managed through a DNS provider. That provider may be your domain registrar, your web hosting company, a dedicated DNS service, or a cloud platform. The provider responsible for the active nameservers is the place where you normally create and edit DNS records. This distinction matters: changing records at a registrar will not affect the live domain if the domain is using nameservers elsewhere.

Before editing DNS, record the current configuration or export it if your provider supports that option. Pay particular attention to mail records. A website can remain online while a careless DNS change interrupts email delivery, domain verification, or third-party services.

DNS record reference

RecordTypical purposeCommon value
APoints a name to an IPv4 addressAn IPv4 address supplied by the host
AAAAPoints a name to an IPv6 addressAn IPv6 address supplied by the host
CNAMEAliases one hostname to another hostnameA provider hostname, such as a target supplied for a subdomain
MXSpecifies where email for a domain should be deliveredA mail-server hostname plus a priority
TXTStores readable text used for verification and email authenticationA provider-issued verification or authentication string
NSIdentifies the authoritative nameservers for a domain or delegated subdomainNameserver hostnames
CAALimits which certificate authorities may issue certificates, when configuredA certificate-authority policy value

Record names and interface labels vary between DNS providers. A provider may also automatically create records for a website, email product, or one-click application. Treat those defaults as part of the service configuration and check them before replacing records in bulk.

What to track

A, AAAA, and CNAME records for websites

An A record connects a hostname to an IPv4 address. It is commonly used for a root domain or a hostname such as www when your hosting provider gives you a server address. An AAAA record performs the equivalent function for IPv6. Add it only when your host supplies an IPv6 destination and the service is configured to accept IPv6 traffic.

A CNAME record points a hostname to another hostname rather than directly to an IP address. It is often useful for subdomains such as blog.example.com or shop.example.com when a hosted platform gives you a destination hostname. A CNAME is generally not used alongside other records for the same exact hostname. Follow the receiving provider's instructions, including any required verification record.

To point a domain to hosting, first identify whether the host expects an A record, an AAAA record, a CNAME, or a nameserver change. Do not assume that every hosting plan uses the same method. Managed WordPress hosting, a website builder, a VPS, and a shared hosting account may provide different connection instructions.

MX records for email

MX records tell other mail systems where to deliver messages for your domain. They contain a destination hostname and a priority value. When more than one MX record exists, the priority helps determine the preferred route; the exact interpretation is controlled by the mail system.

When changing email providers, copy the new provider's complete MX record set, including priorities, and confirm whether old MX records must be removed. Leaving records from two unrelated providers can produce inconsistent delivery. Do not delete TXT records used for SPF, DKIM, or domain verification unless you know they are obsolete. Email authentication records are usually supplied by the email provider and should be copied exactly.

TXT, NS, and CAA records

TXT records are commonly used to verify domain ownership and publish email-authentication information. They may contain long strings, punctuation, or quotation marks. Use the value exactly as supplied and check whether your DNS interface adds quotation marks automatically.

NS records identify the authoritative nameservers. At the domain level, you normally change nameservers at the registrar rather than creating ordinary NS records in the same DNS zone. Delegating a subdomain is a more advanced use: the parent zone can specify different nameservers for that subdomain.

CAA records can express a policy about which certificate authorities may issue certificates for a domain. If you use CAA, make sure it permits the certificate authority used by your hosting or HTTPS provider. A restrictive or outdated CAA configuration can interfere with certificate issuance or renewal. For related HTTPS checks, see the SSL certificate and HTTPS troubleshooting guide.

TTL and the record inventory

TTL, or time to live, tells recursive DNS resolvers how long they may cache a response. A shorter TTL can make a planned change easier to roll back or update, while a longer TTL can reduce the frequency of lookups. TTL does not force every resolver to refresh at the same moment, so it should be treated as a planning control rather than a precise countdown.

Keep a simple inventory with the hostname, record type, destination, purpose, provider, and date last reviewed. Include records for the root domain, www, active subdomains, email, verification services, and any delegated zones.

Cadence and checkpoints

DNS does not need to be changed on a fixed schedule, but it benefits from a monthly or quarterly review for active business domains. A short audit can catch records left behind after a migration, expired verification entries, unexpected mail routes, or subdomains no longer connected to a service.

When changing nameservers

  1. List the records currently required for the website, email, verification services, and subdomains.
  2. Recreate that zone at the new DNS provider before changing the domain's nameservers.
  3. Compare the old and new record lists, paying special attention to MX, TXT, CNAME, and CAA records.
  4. Change the nameservers at the registrar using the exact hostnames supplied by the new provider.
  5. Check the website, email, and important subdomains after the change is visible through multiple DNS lookup tools or resolvers.

Nameserver changes can take time to appear consistently because cached delegation information expires at different times. Keep the previous DNS service available during a planned transition when possible, and avoid making unrelated record changes at the same time.

When pointing a subdomain

  1. Confirm the exact hostname requested by the service, such as app.example.com or store.example.com.
  2. Create the requested A, AAAA, or CNAME record at the authoritative DNS provider.
  3. Complete any verification step in the receiving platform.
  4. Test the subdomain over HTTPS and confirm that the expected application, not a default hosting page, loads.

Avoid creating both an A record and a CNAME for the same hostname. Also check for an existing wildcard record, which may make an unused subdomain appear to work while sending it to the wrong service.

When connecting or renewing email

Save the existing MX and TXT records before following the new provider's setup instructions. Confirm the domain in the provider dashboard, publish the requested verification record, then test inbound and outbound messages. If a provider gives separate SPF, DKIM, or DMARC guidance, treat each as a distinct configuration requirement rather than combining values without instructions.

How to interpret changes

DNS propagation troubleshooting starts with identifying the scope of the failure. If the domain works for some people but not others, cached responses or different resolver paths may be involved. If everyone sees the wrong site, inspect the authoritative record and the hosting account. If the website works but email fails, review MX and mail-authentication records separately from the web records.

Use a DNS lookup tool to query the exact hostname and record type. Check the root domain and www independently; they may have different records. For a CNAME, confirm that the target matches the provider's instructions. For an A record, confirm the IP address and whether the hosting account is configured to respond to the domain.

Common causes of conflicting results include editing a non-authoritative DNS zone, leaving an old A record beside a new CNAME, using the wrong host-field format, or entering the full domain name when the interface automatically appends the domain. Some dashboards represent the root domain with an @ symbol, while others leave the host field blank.

Do not repeatedly edit a record simply because one lookup still shows the old value. First compare the authoritative answer with results from more than one resolver, check the TTL, and confirm that the change was saved. If a change affects production traffic or business email and the cause is unclear, pause further edits and use the provider's documented support or diagnostic process.

When to revisit

Return to this guide whenever you launch a website, move to new cloud hosting, add a subdomain, change an email provider, renew a verification integration, or prepare a domain for a migration. A quarterly DNS review is a reasonable checkpoint for a small business site; review sooner before a seasonal campaign, ecommerce event, major WordPress update, or planned hosting change.

Use this action list for the next review:

  • Confirm which provider controls the authoritative nameservers.
  • Export or document the current DNS zone before editing it.
  • Check A, AAAA, and CNAME records for the root domain and active subdomains.
  • Verify that MX records still point to the intended mail service.
  • Review TXT records for active verification and email-authentication requirements.
  • Check CAA records if HTTPS certificates are issued or renewed through a different provider.
  • Remove obsolete records only after confirming that no live service depends on them.
  • Test the website, email, HTTPS, and key subdomains after planned changes.

Keep the final record inventory with your hosting and domain documentation. That small habit makes future website migration hosting, troubleshooting, and provider changes safer and easier to review.

Related Topics

#DNS#domain management#website hosting#email hosting#nameservers
T

TopShop Cloud 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.