DNS records are instructions that tell the internet where to find your website, email, and other services. Here's a guide to the most common record types and when to use them.
A Record — Points to your website
What it does: Maps your domain name to your server's IPv4 address (a 32-bit numeric address).
Example:
CODE0
When to use:
- Pointing your domain at a web server
- Most common record type
- One domain can have only one A record (or multiple if using round-robin load balancing)
AAAA Record — IPv6 address
What it does: Like an A record, but for IPv6 addresses (modern, longer format addresses).
Example:
CODE1
When to use:
- If your server has an IPv6 address
- Not required for most websites, but increasingly common for modern infrastructure
CNAME Record — Alias to another domain
What it does: Points one domain name to another domain name (a canonical name).
Example:
CODE2
When to use:
- Pointing www to the root domain
- Creating subdomains that point elsewhere
- Pointing to a third-party service (e.g. a blog platform, email service)
Important: Do not create a CNAME record for the root domain (yourdomain.com). Use an A record instead. CNAME records can only be used for subdomains.
MX Record — Email routing
What it does: Directs email for your domain to a mail server. Can have multiple MX records with priority numbers (lower = higher priority).
Example:
CODE3
When to use:
- Enabling email for your domain
- Multiple MX records provide redundancy if the primary mail server is down
- Check with your email provider for the correct MX record values
TXT Record — Text data (SPF, DKIM, DMARC, verification)
What it does: Stores arbitrary text data. Commonly used for email authentication, domain verification, and service configuration.
### SPF (Sender Policy Framework)
Tells mail servers which servers are authorized to send email for your domain:
yourdomain.com TXT v=spf1 include:_spf.google.com ~all
### DKIM (DomainKeys Identified Mail)
Digitally signs your outgoing email to prove it's legitimate:
default._domainkey.yourdomain.com TXT v=DKIM1; k=rsa; p=MIGfMA0BgkqhkiG9w0BAgeQA...
(Your email provider supplies the full DKIM record value.)
### DMARC (Domain-based Message Authentication, Reporting and Conformance)
Sets a policy for how mail servers should handle emails that fail SPF/DKIM:
_dmarc.yourdomain.com TXT v=DMARC1; p=quarantine; rua=mailto:admin@yourdomain.com
### Domain Verification
Some services require a TXT record to verify you own the domain:
yourdomain.com TXT verification-code-here
SRV Record — Service location
What it does: Points to a server for a specific service (like VoIP, instant messaging, or other protocols).
Example:
CODE8
When to use:
- Setting up VoIP/SIP services
- Other specialized protocol services
- Rarely needed for standard websites and email
Format explanation:
- Priority (10) — lower values are tried first
- Weight (60) — for load balancing among same-priority servers
- Port (5061) — the port the service runs on
- Target — the server hostname
NS Record — Nameserver (informational)
What it does: Lists the authoritative nameservers for your domain. These are set at the domain registrar level, not in your DNS zone.
Example:
CODE9
This is typically managed by your hosting provider—you rarely edit NS records directly.
ALIAS or ANAME Record (special)
What it does: Like a CNAME, but allows you to point the root domain to another domain (some DNS providers only).
Example:
CODE10
Not all registrars support this. Check your DNS provider's documentation.
Common record combinations
### Basic website with email
CODE11
### Email-only (no website)
CODE12
TTL (Time To Live)
Every DNS record has a TTL value (usually in seconds). This tells servers how long to cache the record:
- 3600 (1 hour) — common default; changes propagate within an hour
- 300 (5 minutes) — faster propagation if you're making frequent changes
- 86400 (1 day) — longer cache; reduces server load but slower to update
Lower TTL values = faster propagation when you change records, but slightly higher server load.
Tips
- Make DNS changes gradually — change one record at a time if possible
- Lower your TTL before major changes — do this 24 hours before updating critical records
- Keep email records accurate — wrong MX records mean you won't receive email
- SPF/DKIM/DMARC improve deliverability — especially important if you send bulk email
For help pointing your domain at your hosting, see Point your domain at your hosting.