Skip to main content
Cloud Hosting starting at $2.91/mo. Auto-scaling servers with a FREE domain included. Start Now →
Domains

DNS Records Explained: A, CNAME, MX, TXT & NS Records Made Simple

DNS records are the invisible instructions that make your domain work. This guide explains every record type you'll encounter, with real examples and practical instructions for getting them right.

S

Serverlys Team

Jul 4, 2026 · 8 min read

Every time someone types your domain into a browser, a series of lookups happens behind the scenes. Your domain's DNS records tell the internet where to find your website, where to deliver your email, how to verify your domain ownership, and much more. Understanding these records isn't just for system administrators — it's essential knowledge for anyone who manages a website, sets up email, or connects third-party services to their domain.

This guide covers every DNS record type you'll realistically encounter, explains what each one does, and provides practical examples you can reference when configuring your own domain.

What Is DNS and How Does It Work?

DNS stands for Domain Name System. Think of it as the internet's phone book. When you type "serverlys.com" into your browser, your computer doesn't know where that website lives. It needs an IP address — a numerical identifier like 192.168.1.1 — to connect to the right server.

DNS translates human-readable domain names into machine-readable IP addresses. Here's the simplified process:

  1. You type a URL into your browser (e.g., serverlys.com)
  2. Your browser checks its cache to see if it already knows the IP address
  3. If not cached, it queries a DNS resolver (usually run by your ISP or a public service like Cloudflare's 1.1.1.1)
  4. The resolver contacts the root nameservers, which direct it to the TLD nameservers (.com, .io, etc.)
  5. The TLD nameservers point to your domain's authoritative nameservers (set by your registrar or hosting provider)
  6. Your authoritative nameservers return the DNS records for the requested domain
  7. Your browser connects to the IP address specified in the A record and loads the website

This entire process typically takes 20-100 milliseconds. The DNS records stored on your authoritative nameservers control every step of how your domain functions.

The Essential DNS Record Types

A Record (Address Record)

The A record is the most fundamental DNS record. It maps a domain name to an IPv4 address (the 32-bit addresses like 93.184.216.34). When someone visits your website, the A record tells their browser which server to connect to.

Example:

Host Type Value TTL
@ A 93.184.216.34 3600
www A 93.184.216.34 3600

The "@" symbol represents your root domain (e.g., yourdomain.com without any prefix). The "www" entry handles requests to www.yourdomain.com. Both should typically point to the same IP address.

When you need it: Always. Every domain that hosts a website needs at least one A record. Your hosting provider will give you the IP address to use.

AAAA Record (IPv6 Address Record)

The AAAA record is the IPv6 equivalent of the A record. IPv6 addresses are 128-bit addresses that look like 2001:0db8:85a3:0000:0000:8a2e:0370:7334. As IPv4 addresses become scarce, IPv6 adoption is increasing, and supporting it improves your site's accessibility and future-proofs your DNS configuration.

When you need it: When your hosting provider supplies an IPv6 address. It's good practice to add AAAA records alongside A records when available.

CNAME Record (Canonical Name Record)

A CNAME record creates an alias that points one domain name to another domain name (not an IP address). Instead of looking up the IP directly, a CNAME tells the DNS resolver to look up the target domain's A record instead.

Example:

Host Type Value TTL
www CNAME yourdomain.com 3600
blog CNAME yourblog.wordpress.com 3600
shop CNAME shops.myshopify.com 3600

CNAME records are especially useful when connecting third-party services. If you host your blog on WordPress.com, your shop on Shopify, or your landing pages on a marketing platform, you'll use CNAME records to point subdomains to those services.

Important rule: A CNAME record cannot coexist with other record types for the same hostname. You cannot have both a CNAME and an A record for "www" — they conflict. Also, you should never set a CNAME on your root domain (@), as this can break other records like MX.

Serverlys Tip: When connecting third-party services to subdomains, always verify the CNAME value provided by the service. A typo in a CNAME record means the subdomain will fail to resolve entirely. Serverlys DNS management makes it easy to add and verify CNAME records for all your services. Get started with Serverlys domains.

MX Record (Mail Exchange Record)

MX records tell the internet where to deliver email for your domain. When someone sends an email to you@yourdomain.com, the sending mail server looks up your domain's MX records to find which mail server should receive the message.

Example (using Google Workspace):

Host Type Priority Value
@ MX 1 aspmx.l.google.com
@ MX 5 alt1.aspmx.l.google.com
@ MX 5 alt2.aspmx.l.google.com
@ MX 10 alt3.aspmx.l.google.com

The priority number determines the order in which mail servers are tried. Lower numbers have higher priority. If the primary server (priority 1) is unavailable, the sending server tries the next highest priority, and so on. This provides redundancy for email delivery.

When you need it: Whenever you use email with your domain. Your email provider (Google Workspace, Microsoft 365, Zoho, etc.) will provide the exact MX records to enter.

TXT Record (Text Record)

TXT records store arbitrary text data associated with your domain. They're used for a variety of purposes, most commonly domain verification and email security. TXT records have become increasingly important as email authentication standards have evolved.

Common uses:

Example SPF record:

Host Type Value
@ TXT v=spf1 include:_spf.google.com ~all

This SPF record says: "Only Google's mail servers are authorized to send email from this domain. Emails from other servers should be treated with suspicion (~all)."

Example DMARC record:

Host Type Value
_dmarc TXT v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.com

"If you're running email on your domain and haven't set up SPF, DKIM, and DMARC records, your emails are more likely to land in spam folders. These three TXT records are non-negotiable for email deliverability in 2026."

NS Record (Nameserver Record)

NS records specify which nameservers are authoritative for your domain. These are the servers that hold all your other DNS records and respond to queries about your domain. When you change your nameservers, you're changing where the internet looks for your DNS records.

Example:

Host Type Value
@ NS ns1.serverlys.com
@ NS ns2.serverlys.com

Most domains have at least two NS records for redundancy. If one nameserver goes down, the other can still serve your DNS records. You typically set NS records at your domain registrar, and they determine which DNS provider manages your domain's records.

Additional DNS Record Types

SRV Record (Service Record)

SRV records specify the location of specific services on your domain. They're used by protocols like SIP (voice over IP), XMPP (chat), and Microsoft services. SRV records include priority, weight, port, and target information.

When you need it: When setting up VoIP services, Microsoft Teams/Skype for Business, or other services that use SRV-based discovery.

CAA Record (Certificate Authority Authorization)

CAA records specify which certificate authorities (CAs) are allowed to issue SSL/TLS certificates for your domain. This prevents unauthorized CAs from issuing certificates that could be used in man-in-the-middle attacks.

Example:

Host Type Value
@ CAA 0 issue "letsencrypt.org"

PTR Record (Pointer Record)

PTR records are the reverse of A records — they map IP addresses back to domain names. They're primarily used for reverse DNS lookups, which email servers use to verify the identity of sending servers. You typically don't manage PTR records yourself; your hosting provider sets them on their IP addresses.

Understanding TTL (Time to Live)

Every DNS record has a TTL value, measured in seconds, that determines how long DNS resolvers should cache the record before checking for updates. TTL is a critical setting that affects how quickly changes to your DNS records take effect.

TTL Value Duration Use Case
300 5 minutes Records you change frequently, or before a planned migration
3600 1 hour Standard setting for most records
86400 24 hours Stable records that rarely change (like NS records)

Pro tip for migrations: Before changing your A records (like when switching hosting providers), lower the TTL to 300 seconds a day or two in advance. This ensures that once you make the change, it propagates within minutes instead of hours. After the migration is complete and verified, raise the TTL back to 3600 or higher.

Serverlys Tip: When transferring your domain or switching hosting providers, lowering your TTL in advance is the single most important step for minimizing downtime. Our DNS management panel lets you adjust TTL values with one click.

Common DNS Configurations

Basic Website + Email Setup

Here's what a typical DNS configuration looks like for a small business with a website and Google Workspace email:

Host Type Value TTL
@ A 203.0.113.50 3600
www CNAME yourdomain.com 3600
@ MX aspmx.l.google.com (pri 1) 3600
@ TXT v=spf1 include:_spf.google.com ~all 3600
google._domainkey TXT [DKIM key from Google] 3600
_dmarc TXT v=DMARC1; p=quarantine 3600

Website with Third-Party Services

If you use Shopify for e-commerce, HubSpot for marketing, and Mailchimp for newsletters, your DNS might include additional CNAME records:

Host Type Value
shop CNAME shops.myshopify.com
landing CNAME youraccount.hs-sites.com
email CNAME mailchimp.com

Troubleshooting DNS Issues

Changes Not Taking Effect

The most common DNS issue is changes that seem to take forever to propagate. DNS propagation can take up to 48 hours in the worst case, though it usually completes within 1-4 hours. If your changes aren't showing up, check the TTL of the old record — resolvers will cache the old value for that duration.

Email Not Working

If email stops working after DNS changes, check your MX records first. A misconfigured or missing MX record means email has nowhere to go. Also verify your SPF record is correct — an overly restrictive SPF record can cause your outgoing emails to be rejected by recipients.

Website Showing Wrong Content

If your domain shows the wrong website, your A record likely points to the wrong IP address. Verify the correct IP with your hosting provider and update the A record. If you recently migrated, this may be a caching issue — clear your browser cache and try again.

Frequently Asked Questions

How long does it take for DNS changes to propagate?

DNS propagation typically takes 1-4 hours but can take up to 48 hours in rare cases. The speed depends on the TTL of the existing record and how aggressively different ISPs cache DNS responses. Lowering your TTL before making changes helps speed up propagation.

Can I have multiple A records for the same domain?

Yes. Multiple A records for the same hostname enable round-robin DNS, where traffic is distributed across multiple IP addresses. This is a basic form of load balancing used by some large websites.

What happens if I delete all my DNS records?

Your domain will stop working entirely. Without A records, your website won't load. Without MX records, email won't be delivered. Without NS records, the domain becomes unreachable. Always back up your DNS records before making changes.

Should I manage DNS at my registrar or my hosting provider?

Either works, but managing DNS at your hosting provider often simplifies setup since they can auto-configure records. If you use Serverlys for both domain registration and hosting, DNS records are configured automatically.

What is DNS over HTTPS (DoH)?

DNS over HTTPS encrypts DNS queries, preventing ISPs and network operators from seeing which domains you're looking up. It doesn't change how you manage your DNS records — it changes how end users' DNS queries are transmitted. Major browsers support DoH by default in 2026.

Related Articles

DNS management made simple

Serverlys includes a full DNS management panel with every domain registration. Add, edit, and monitor your DNS records with an intuitive interface.