Configure DNS Records for Your Domain in cPanel Step-by-Step

By Raman Kumar

Share:

Updated on Apr 30, 2026

Configure DNS Records for Your Domain in cPanel Step-by-Step

Understanding DNS Records in cPanel

DNS management through cPanel gives you direct control over how visitors find your website and services. Whether you're pointing a new domain to your hosting account or setting up custom email routing, understanding DNS record types helps you avoid common configuration mistakes that can take your site offline.

Most hosting customers need to work with five core DNS record types. A records point your domain to server IP addresses. CNAME records create aliases for subdomains. MX records handle email routing. TXT records verify domain ownership for third-party services. NS records delegate DNS authority to specific nameservers.

Before making changes, check your current DNS propagation status. Changes can take 4-48 hours to fully propagate worldwide, depending on your TTL settings and local ISP caching policies.

Access the DNS Zone Editor in cPanel

Log into your cPanel account and locate the "Domains" section. Click on "Zone Editor" or "DNS Zone Editor" depending on your cPanel version.

You'll see a list of domains associated with your hosting account. Each domain displays its current DNS records in a table format. The interface shows record type, name, TTL (Time To Live), and the destination value for each entry.

For Hostperl shared hosting customers, the Zone Editor automatically populates essential records when you add a domain. This includes basic A records pointing to your server's IP address and default MX records for email functionality.

Select "Manage" next to the domain you want to edit. This opens the detailed DNS management interface where you can add, modify, or delete specific records.

Configure A Records for Domain and Subdomain Pointing

A records connect domain names directly to IP addresses. Start by adding your primary domain's A record if it's not already configured.

Click "Add Record" and select "A" from the record type dropdown. In the "Name" field, enter your domain name without the protocol (example.com, not https://example.com). Leave this blank for the root domain, or enter a subdomain name like "www" or "shop".

Enter your server's IP address in the "Address" field. Your hosting provider supplies this IP address in your welcome email or account dashboard. For Hostperl customers, you can find your server IP in the client portal under "Services".

Set the TTL value based on how frequently you expect to change this record. Use 3600 seconds (1 hour) for records you might modify during maintenance. Use 86400 seconds (24 hours) for stable production records. Lower TTL values propagate faster but create more DNS queries.

Save the record and verify it's working by running a DNS lookup: nslookup yourdomain.com from your local machine.

Set Up CNAME Records for Subdomain Aliases

CNAME records create aliases that point to other domain names rather than direct IP addresses. Use these for subdomains that should inherit their target's IP address automatically.

Common CNAME setups include pointing "www.yourdomain.com" to "yourdomain.com" or creating service-specific subdomains like "mail.yourdomain.com" that point to your email provider's servers.

Add a new CNAME record by selecting it from the record type menu. Enter the subdomain name in the "Name" field (just "www", not "www.yourdomain.com"). In the "Destination" field, enter the fully qualified domain name you're pointing to, including the trailing dot: "yourdomain.com."

Never create CNAME records for root domains. DNS standards prohibit CNAME records at the apex level where other record types like MX or NS must exist.

Test CNAME records with: dig CNAME subdomain.yourdomain.com to verify the alias resolves correctly.

Configure MX Records for Email Routing

MX records tell other email servers where to deliver mail for your domain. Most hosting accounts include default MX records, but you'll need to modify these when using external email services like Google Workspace or Microsoft 365.

Each MX record includes a priority number (lower numbers = higher priority) and a mail server hostname. Email systems try the highest priority server first, then fall back to lower priority servers if needed.

To configure Gmail for your domain, delete existing MX records and add these Google entries:

  • Priority 1: aspmx.l.google.com.
  • Priority 5: alt1.aspmx.l.google.com.
  • Priority 5: alt2.aspmx.l.google.com.
  • Priority 10: alt3.aspmx.l.google.com.
  • Priority 10: alt4.aspmx.l.google.com.

For hosting customers keeping email with their provider, leave the default MX records unchanged. Hostperl VPS hosting plans include full email server functionality with spam filtering and webmail access.

Verify MX record changes with: dig MX yourdomain.com to see the priority-ordered list of mail servers.

Add TXT Records for Domain Verification

TXT records store text-based information for domain verification, SPF email authentication, and various third-party service confirmations.

Google, Microsoft, and other services require TXT record verification before you can use their platforms with your domain. These verification strings typically look like random character combinations that prove domain ownership.

Add a TXT record by selecting the type and entering the exact verification string provided by your service. Most verification records use "@" or leave the name field blank to apply to the root domain.

SPF records prevent email spoofing by listing authorized servers that can send email from your domain. A basic SPF record looks like: v=spf1 include:_spf.google.com ~all for Google Workspace users.

DKIM and DMARC records also use TXT format for advanced email authentication. These help prevent your domain from being used in phishing attacks and improve email deliverability to major providers.

Always copy verification strings exactly as provided. Extra spaces or missing characters will cause verification failures that can delay service activation.

Manage NS Records for Nameserver Delegation

NS (Name Server) records delegate DNS authority for your domain or specific subdomains to particular nameserver systems. Most hosting customers don't need to modify NS records unless they're using external DNS services or creating subdomain delegation.

Your domain registrar controls the authoritative NS records that point to your hosting provider's nameservers. cPanel's Zone Editor only manages NS records for subdomains within your hosted domain.

To delegate a subdomain to external nameservers, create NS records pointing the subdomain to the target nameserver hostnames. This is common when using separate services for specific subdomains like "shop.yourdomain.com" hosted on an e-commerce platform.

Subdomain NS delegation requires at least two nameserver records for redundancy. The subdomain delegation takes effect after DNS propagation completes.

DNS Propagation and Troubleshooting

DNS changes don't take effect immediately worldwide. Propagation depends on TTL values, ISP caching policies, and geographic distribution of DNS servers.

Use online propagation checkers to monitor how your changes are spreading across different global locations. These tools query multiple DNS servers and show you which locations have updated records versus which still show old information.

Common DNS issues include mismatched TTL values causing inconsistent propagation, missing trailing dots in record values, and conflicting records that create resolution problems.

If your site becomes unreachable after DNS changes, check your A records first. Verify the IP address matches your hosting server. Contact your hosting provider if you're unsure about the correct server IP address.

Browser DNS caching can make it appear that changes haven't taken effect on your local machine while they're working globally. Flush your local DNS cache or test from a different network to get accurate results.

The email server setup tutorial covers additional DNS configuration needed for mail servers, including reverse DNS and additional verification records.

Advanced DNS Configuration Tips

Wildcard records use asterisk (*) notation to catch all undefined subdomains. Add an A record with "*" as the name to point any subdomain requests to a specific IP address. This is useful for applications that create dynamic subdomains.

SRV records define services available on specific ports. These are less common for basic hosting but necessary for some applications like Microsoft Exchange or SIP telephony services.

AAAA records work like A records but for IPv6 addresses. Add these if your hosting provider offers IPv6 connectivity and you want to ensure compatibility with IPv6-only networks.

Load balancing requires multiple A records with the same name pointing to different IP addresses. DNS resolvers randomly select between the available IPs, distributing traffic across multiple servers.

Keep detailed records of your DNS configuration, especially when managing multiple domains or complex setups. Document the purpose of each custom record to avoid confusion during future updates or troubleshooting.

Need reliable hosting with easy DNS management? Hostperl's hosting plans include intuitive cPanel access and full DNS control for all your domains. Our New Zealand-based support team can help you configure complex DNS setups during migrations or new launches.

Frequently Asked Questions

How long do DNS changes take to propagate globally?

Most DNS changes propagate within 4-24 hours, but full global propagation can take up to 48 hours. TTL values in your records affect propagation speed—lower TTL values propagate faster but increase DNS query load.

Can I point multiple domains to the same IP address?

Yes, create A records for each domain pointing to the same IP address. Your web server configuration determines which content each domain displays. Most hosting providers support unlimited parked domains on their plans.

What happens if I delete the wrong DNS record?

Your site or email may become unreachable until you restore the correct record. cPanel doesn't automatically backup DNS changes, so document your current records before making modifications. Contact support immediately if you accidentally delete critical records.

Should I use CNAME or A records for subdomains?

Use CNAME records when the subdomain should inherit IP address changes from its target domain automatically. Use A records when you need the subdomain to point to a specific IP address that may differ from your main domain.

Why isn't my MX record change working for email?

Email providers often cache MX records longer than other DNS record types. Verify your MX records are correctly configured, wait at least 24 hours for propagation, and test from multiple email services to confirm the changes are working globally.