Introduction
DNS (Domain Name System) records are instructions that tell the internet how to handle requests for your domain. Understanding these records is essential for managing your website, email, and other online services. This guide explains the most common DNS record types and how to manage them.
What is DNS?
DNS is like the internet's phone book. It translates human-readable domain names (like yourdomain.com) into computer-readable IP addresses (like 192.168.1.1). DNS records are the entries in this phone book that specify where different services for your domain are located.
Common DNS Record Types
A Record (Address Record)
Purpose: Points a domain or subdomain to an IPv4 address
Common Uses:
- Pointing your main domain to your web server
- Pointing subdomains to specific servers
- Directing www to your website
Example:
- Name: @ (or blank, represents yourdomain.com)
- Type: A
- Value: 192.0.2.1 (your server IP)
- TTL: 14400
Result: When someone visits yourdomain.com, they're directed to the server at 192.0.2.1
AAAA Record
Purpose: Points a domain or subdomain to an IPv6 address (newer IP format)
Common Uses:
- Same as A record but for IPv6
- Increasingly important as internet moves to IPv6
Example:
- Name: @
- Type: AAAA
- Value: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
CNAME Record (Canonical Name)
Purpose: Points a domain or subdomain to another domain name (alias)
Common Uses:
- Pointing www to your main domain
- Creating subdomains that point to external services
- CDN configuration
Example:
- Name: www
- Type: CNAME
- Value: yourdomain.com
Result: www.yourdomain.com points to wherever yourdomain.com points
Important Rules:
- Cannot create CNAME for root domain (@)
- CNAME cannot coexist with other records for the same name
- CNAME must point to a domain name, not an IP address
MX Record (Mail Exchange)
Purpose: Specifies mail servers responsible for receiving email
Common Uses:
- Directing email to your hosting provider's mail server
- Configuring Google Workspace / Microsoft 365 email
- Setting up custom email solutions
Example:
- Name: @ (or yourdomain.com)
- Type: MX
- Value: mail.yourdomain.com
- Priority: 0 (lower number = higher priority)
Multiple MX Records:
You can have multiple MX records for redundancy:
- Priority 0: mail.yourdomain.com (primary)
- Priority 10: mail2.yourdomain.com (backup)
TXT Record (Text Record)
Purpose: Stores text information for various purposes
Common Uses:
- SPF (Sender Policy Framework) - email authentication
- DKIM (DomainKeys Identified Mail) - email authentication
- DMARC (Domain-based Message Authentication) - email policy
- Domain verification for services (Google, Microsoft, etc.)
- Site verification codes
Example SPF Record:
- Name: @
- Type: TXT
- Value:
v=spf1 include:_spf.yourhostingprovider.com ~all
Example Domain Verification:
- Name: @
- Type: TXT
- Value:
google-site-verification=abc123xyz789
NS Record (Nameserver)
Purpose: Specifies authoritative nameservers for the domain
Common Uses:
- Delegating subdomains to different nameservers
- Usually managed at registrar level, not in cPanel
Note: Typically, you don't need to edit NS records in cPanel, as these are set at your domain registrar.
SRV Record (Service Record)
Purpose: Specifies location of specific services
Common Uses:
- Microsoft 365 services
- VoIP / SIP services
- Gaming servers
- XMPP/Jabber chat services
Example:
- Service: _sip
- Protocol: _tcp
- Port: 5060
- Target: sip.yourdomain.com
- Priority: 10
- Weight: 60
Managing DNS Records in cPanel
Accessing Zone Editor
- Log into cPanel
- Navigate to "Domains" section
- Click "Zone Editor"
- Select your domain (or click "Manage" next to it)
Adding a DNS Record
- In Zone Editor, click "+ Add Record" or the specific record type button
- Enter record details:
- Name: Subdomain or @ for root domain
- TTL: Time to Live (14400 is common)
- Type: Select record type (A, CNAME, MX, etc.)
- Record: Destination (IP, domain, or text value)
- Click "Add Record" to save
Editing a DNS Record
- Find the record in the list
- Click "Edit" next to the record
- Modify the values
- Click "Save Record"
Deleting a DNS Record
- Find the record in the list
- Click "Delete" next to the record
- Confirm deletion
Warning: Deleting critical DNS records (A, MX) can break your website or email. Always verify before deleting.
Common DNS Configurations
Basic Website Setup
@ (root) A 192.0.2.1
www CNAME yourdomain.com
mail A 192.0.2.1
@ MX mail.yourdomain.com (Priority: 0)
Using Google Workspace for Email
@ MX ASPMX.L.GOOGLE.COM (Priority: 1)
@ MX ALT1.ASPMX.L.GOOGLE.COM (Priority: 5)
@ MX ALT2.ASPMX.L.GOOGLE.COM (Priority: 5)
@ MX ALT3.ASPMX.L.GOOGLE.COM (Priority: 10)
@ MX ALT4.ASPMX.L.GOOGLE.COM (Priority: 10)
@ TXT v=spf1 include:_spf.google.com ~all
Subdomain for Application
app A 192.0.2.50
Result: app.yourdomain.com points to 192.0.2.50
CDN Configuration
www CNAME xyz123.cloudfront.net
TTL (Time To Live) Explained
What is TTL?
TTL specifies how long (in seconds) DNS records should be cached before checking for updates.
Common TTL Values
- 300 (5 minutes): Use when making frequent changes
- 3600 (1 hour): Reasonable for active development
- 14400 (4 hours): Default for most records
- 86400 (24 hours): For stable, rarely-changed records
Best Practices
- Lower TTL (300) before making major DNS changes
- Wait for old TTL to expire before making changes
- Increase TTL (86400) after changes stabilize to reduce DNS queries
Email Authentication Records
SPF (Sender Policy Framework)
Purpose: Specifies which mail servers can send email for your domain
Example:
v=spf1 include:_spf.yourhostingprovider.com ~all
Components:
v=spf1- SPF versioninclude:_spf.yourhostingprovider.com- Authorized servers~all- Soft fail for unauthorized servers
DKIM (DomainKeys Identified Mail)
Purpose: Adds digital signature to verify email authenticity
DKIM records are usually auto-generated in cPanel. You can find them in:
- cPanel > Email > Email Deliverability
- Click "Manage" next to your domain
- View DKIM record (or install if not present)
DMARC (Domain-based Message Authentication)
Purpose: Specifies policy for handling emails that fail SPF/DKIM
Example:
_dmarc TXT v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.com
DNS Propagation
What is Propagation?
When you change DNS records, the changes don't take effect immediately worldwide. Propagation is the time it takes for DNS changes to spread across the internet.
Propagation Time
- Typical: 1-4 hours
- Maximum: Up to 48 hours (rare)
- Affected by: TTL value of old record
Checking Propagation
- WhatsMyDNS.net
- DNSChecker.org
- Command line:
nslookup yourdomain.comordig yourdomain.com
Troubleshooting DNS Issues
Website Not Loading
- Verify A record points to correct IP address
- Check DNS propagation status
- Ensure nameservers are correct
- Clear browser cache and DNS cache
Email Not Working
- Verify MX records point to correct mail server
- Ensure MX record priority is set correctly
- Check SPF record is configured
- Wait for DNS propagation
Subdomain Not Resolving
- Verify A or CNAME record exists for subdomain
- Check for typos in record name or value
- Wait for propagation
- Clear DNS cache
CNAME Conflicts
Error: "CNAME record already exists" or "CNAME conflicts with other records"
- Delete conflicting A or other records first
- Remember: CNAME cannot coexist with other record types for same name
- Use A record instead if CNAME doesn't work
Best Practices
Security
- Enable SPF, DKIM, and DMARC for email authentication
- Regularly audit DNS records for unauthorized changes
- Use strong passwords for cPanel and domain registrar accounts
- Enable two-factor authentication where available
Management
- Document all DNS changes and their purposes
- Lower TTL before making major changes
- Test changes before deploying to production
- Keep records organized and remove unused entries
- Backup DNS zone files periodically
Performance
- Use appropriate TTL values (higher for stable records)
- Minimize number of DNS lookups when possible
- Use CNAME for aliases rather than duplicate A records
Advanced Topics
CAA Records
Control which Certificate Authorities can issue SSL certificates for your domain:
@ CAA 0 issue "letsencrypt.org"
Wildcard DNS
Point all subdomains to the same location:
* A 192.0.2.1
Result: any.subdomain.yourdomain.com points to 192.0.2.1
Need Help?
DNS can be complex. If you need assistance with DNS configuration, please contact our support team with:
- Your domain name
- What you're trying to achieve
- Any error messages
- Screenshots of current DNS settings (if applicable)
