Tutorials7 min read

DNS Explained for Beginners: A Records, CNAME, MX, and TXT Records

S

SNBD Host Team

July 13, 2026

DNS records are the settings that tell the internet what to do with your domain name. They control where your website loads from, where emails get delivered, and what services are connected to your domain. If you've ever stared at a DNS management panel feeling completely lost, this guide will fix that. We'll cover every record type you'll actually encounter — with real examples.

How DNS Works (the Short Version)

When someone types yoursite.com in their browser, their device asks a DNS resolver (usually provided by their ISP or a public service like Google's 8.8.8.8) to translate that name into an IP address. The resolver looks up your domain's DNS records, finds the right IP, and connects the visitor to your server.

Your DNS records are stored on nameservers — servers that act like a phone book for your domain. When you register a domain and point it to a hosting provider, you're telling the internet "this nameserver has the authoritative answers for this domain."

DNS changes propagate globally as various caches expire, which is why updates can take anywhere from a few minutes to 48 hours to be visible everywhere. This is called DNS propagation.

A Record — The Core Record

An A record maps a domain name (or subdomain) to an IPv4 address. This is the most fundamental DNS record — it's what tells browsers which server to connect to when loading your website.

Example

Type: A
Name: @          (@ means the root domain: yoursite.com)
Value: 103.243.147.45
TTL: 3600

This tells DNS: "When someone requests yoursite.com, send them to the server at 103.243.147.45."

You can also set A records for subdomains:

Type: A
Name: blog
Value: 103.243.147.45

This makes blog.yoursite.com point to the same server. If you want it on a different server, use a different IP.

When you'll use it: Every time you connect a domain to a web hosting server. Your hosting provider gives you an IP address — you create an A record pointing your domain to that IP.

AAAA Record — Same as A, But for IPv6

An AAAA record does exactly what an A record does, but for IPv6 addresses (the newer, longer format like 2400:cb00:2048:1::c629:d7a2). If your hosting server supports IPv6, your host will give you both an IPv4 and IPv6 address. Most modern hosting setups include both A and AAAA records automatically.

CNAME Record — The Alias

A CNAME record (Canonical Name) creates an alias that points one domain name to another domain name — not to an IP address. It's like saying "when you look up www, go look up the answer for this other name instead."

Example

Type: CNAME
Name: www
Value: yoursite.com

This makes www.yoursite.com resolve to whatever yoursite.com resolves to. When your IP changes, you only update the A record for the root domain — the www CNAME follows automatically.

Common CNAME use cases

  • www subdomain — nearly universal. Points www.yoursite.com to yoursite.com
  • Custom subdomain for SaaS tools — e.g., mail.yoursite.com pointing to ghs.googlehosted.com for Google Workspace
  • Shopify or other hosted platforms — they give you a CNAME target to point your domain at
  • CDN verification — services like Cloudflare use CNAMEs to verify domain ownership

Important rule: You cannot use a CNAME on the root domain (@). The root domain must use an A record (or AAAA). Only subdomains can use CNAME.

MX Record — Email Delivery

MX records (Mail Exchange) tell the internet where to deliver emails sent to your domain. When someone sends an email to you@yoursite.com, their mail server looks up the MX records for yoursite.com to know which mail server to deliver to.

Example — Google Workspace MX records

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

The priority number tells mail servers which server to try first — lower number = higher priority. Multiple MX records provide redundancy: if the primary mail server is unreachable, the sending server tries the next one in priority order.

When you'll use it: Every time you set up email for your domain. Whether you're using Google Workspace, Microsoft 365, cPanel mail, or any other email service, they'll give you MX records to add.

If you delete your MX records, email to your domain stops working entirely — emails bounce back to senders.

TXT Record — Verification and Authentication

TXT records store text information associated with your domain. They have two main jobs: proving domain ownership to third-party services, and setting email authentication policies.

Domain verification

Google, Microsoft, and many other services verify that you own a domain by asking you to add a specific TXT record. They check for the record, and if it's there, ownership is confirmed. Example:

Type: TXT
Name: @
Value: google-site-verification=abc123xyz456

SPF — Sender Policy Framework

SPF tells receiving mail servers which IP addresses and services are authorised to send email on behalf of your domain. This prevents spammers from forging your domain in email from. Example:

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

This says "only Google's servers are authorised to send email for this domain. Anything else is suspicious."

DKIM — DomainKeys Identified Mail

DKIM adds a cryptographic signature to outgoing emails so receiving servers can verify they weren't tampered with in transit. Your email provider generates the DKIM keys and gives you a long TXT record to add:

Type: TXT
Name: google._domainkey
Value: v=DKIM1; k=rsa; p=MIIBIjANBgkq...

DMARC — Domain-based Message Authentication

DMARC tells receiving servers what to do if an email fails SPF or DKIM checks — ignore it, quarantine it, or reject it outright. Example:

Type: TXT
Name: _dmarc
Value: v=DMARC1; p=quarantine; rua=mailto:postmaster@yoursite.com

Together, SPF, DKIM, and DMARC significantly improve your email deliverability and protect your domain from being used in phishing attacks. If you're using Google Workspace or Microsoft 365 for business email, set all three up — your email provider's documentation will walk you through it.

NS Record — Nameservers

NS records (Nameserver) define which servers are authoritative for your domain's DNS. These are set at your domain registrar and tell the world "go ask this nameserver for DNS records about this domain."

Type: NS  Value: ns1.snbdhost.com
Type: NS  Value: ns2.snbdhost.com

When you move your domain to a new hosting provider, you update the NS records (called "changing nameservers") so DNS queries go to the new provider's servers. This is different from updating individual DNS records — changing nameservers hands all DNS control to the new provider.

TTL — Time to Live

Every DNS record has a TTL (Time to Live) value measured in seconds. This tells DNS resolvers how long to cache (remember) the record before checking for updates.

  • Low TTL (300 seconds / 5 minutes) — Changes propagate faster, but causes more DNS lookups. Use this before planned migrations.
  • High TTL (86400 seconds / 24 hours) — Fewer DNS queries, but changes take longer to propagate globally.

Best practice: reduce TTL to 300 a day before making DNS changes, make your changes, then restore to 3600 or 86400 once everything is working.

Quick Reference: Which Record Does What

  • A — Points domain/subdomain to an IPv4 address (web server)
  • AAAA — Points domain/subdomain to an IPv6 address
  • CNAME — Points a subdomain to another domain name (alias)
  • MX — Routes email delivery to a mail server
  • TXT — Domain verification, SPF, DKIM, DMARC
  • NS — Defines which nameservers are authoritative for the domain
  • SRV — Defines specific services (used by VoIP, SIP, some Microsoft services)
  • CAA — Specifies which Certificate Authorities can issue SSL certificates for your domain

With SNBD HOST's DNS management panel, you can add, edit, and delete all of these record types through a clean web interface — no command line required. DNS changes are applied within minutes on SNBD HOST's nameservers.

dns explaineda record dnscname recordmx recordtxt recorddns tutorial bangladeshdomain dns setup
S

Written by

SNBD Host Team

The SNBD Host team shares hosting guides, automation tips, and business growth strategies for Bangladeshi entrepreneurs.

Share Article