How to create a CNAME Record in cPanel and WHM

1. Introduction

Website administration needs proper domain name handling as its critical foundation. Domain management relies heavily on CNAME records because these DNS entries facilitate traffic redirection between two different domain names. Managers who understand how to operate CNAME records within cPanel and WHM enjoy better domain redirections while improving subdomain control and expanding third-party platform connectivity. Users can follow the guide to learn a clear procedure for CNAME record setup in cPanel and WHM together with troubleshooting methods and effective DNS management practices.

2. Understanding CNAME Records

Definition and Function of a CNAME Record

A CNAME (Canonical Name) record is a type of DNS record that maps one domain name (alias) to another domain name (canonical name). This is useful when you want multiple domain names to resolve to the same server without needing separate A records.

Difference Between CNAME and Other DNS Records

  • A Record → Maps a domain to an IP address
  • MX Record → Specifies mail servers for handling email
  • TXT Record → Stores arbitrary text for verification and authentication

Unlike an A record, which points a domain to an IP address, a CNAME points a domain to another domain name.

Advantages and Limitations of CNAME Records

Advantages:

  • Useful for pointing multiple subdomains to a single hostname
  • Simplifies DNS management when IP addresses change frequently

Limitations:

  • Cannot be used for root domains (e.g., example.com)
  • Slower than A records due to additional DNS lookup time

3. Prerequisites for Creating a CNAME Record

  • An account that enables DNS zone management through cPanel or WHM interfaces
  • DNS modification requires the owner of the domain to have proper control rights.
  • No conflicting DNS entries, such as an existing A record for the alias

4. How to Create a CNAME Record in cPanel

  1. Step 1: Log Into cPanel
    Open your browser and navigate to https://yourdomain.com/cpanel
    Enter your username and password to access the dashboard.
  2. Step 2: Navigate to the DNS Zone Editor
    Locate the Domains section
    Click Zone Editor to open the DNS configuration panel.
  3. Step 3: Select the Domain Name
    Find the domain for which you need to add a CNAME record
    Click Manage next to the respective domain.
  4. Step 4: Add a New CNAME Record
    Click Add Record and select CNAME
    In the Name field, enter the subdomain (e.g., blog.example.com)
    In the CNAME field, enter the destination hostname (e.g., example.website.com).
  5. Step 5: Save and Verify
    Click Save Record
    Wait for the changes to propagate, which can take up to 24 hours.

5. How to Create a CNAME Record in WHM

  1. Step 1: Log Into WHM
    Access WHM at https://yourserver.com/whm
    Enter your root credentials to log in.
  2. Step 2: Locate the DNS Functions Section
    In the left sidebar, search for Edit DNS Zone
    Click on Edit DNS Zone and select the relevant domain.
  3. Step 3: Add a CNAME Entry
    Scroll to the bottom and locate the Add New Entries Below This Line section
    In the First Field, enter the subdomain name (e.g., store.example.com)
    In the Type Field, select CNAME
    In the Last Field, enter the destination domain (e.g., shopify.example.com).
  4. Step 4: Save and Apply Changes
    Click Save
    Test using DNS lookup tools to confirm propagation.

6. Troubleshooting CNAME Issues

CNAME Record Not Resolving Properly

  • Check if there is an A record conflict for the same hostname
  • Ensure the CNAME entry points to a valid domain name

DNS Propagation Delays

  • DNS updates can take a few minutes to 24 hours to propagate
  • Use tools like whatsmydns.net to check real-time status

Incorrect Target Address Issues

  • Ensure the target domain exists and resolves properly
  • Check for spelling errors in the destination hostname

7. Best Practices for Managing CNAME Records

  • ✔ Avoid CNAME Chains → Too many redirects slow down resolution
  • ✔ Use CNAME for Subdomains → Point blog.example.com to example.wordpress.com
  • ✔ Keep DNS Records Organized → Regularly audit DNS settings

8. Testing and Verifying CNAME Records

Using Online DNS Tools

Command Line Methods

  • On Windows: nslookup blog.example.com
  • On Linux/macOS: dig blog.example.com

9. Impact of CNAME Records on Website Performance

  • Increased DNS resolution time can slow website loading
  • Optimizing DNS configurations reduces latency
  • CNAME flattening (offered by some DNS providers) speeds up resolution

10. Security Considerations When Using CNAME Records

  • Avoid pointing to unreliable third-party services
  • Implement DNSSEC to prevent DNS spoofing

11. Common Use Cases for CNAME Records

  • 🔹 Setting up branded email services (e.g., mail.example.com → Google Workspace)
  • 🔹 Redirecting subdomains (e.g., support.example.com → zendesk.com)

12. When to Use a CNAME vs. an A Record

  • 📌 CNAME → When pointing to another domain
  • 📌 A Record → When pointing to an IP address

13. Removing or Modifying a CNAME Record

  • Edit via cPanel’s Zone Editor or WHM’s DNS Manager
  • Understand TTL settings to manage caching

14. Advanced CNAME Configurations

  • CNAME Flattening → Eliminates extra lookup time
  • Using CNAME with Cloudflare → Enhances security and performance

15. Alternative Methods for Domain Forwarding

  • URL Forwarding → Redirects without DNS changes
  • Server-side configurations → Allows advanced routing

16. Understanding TTL and DNS Propagation

  • Set low TTL values for quick changes
  • Use ipconfig /flushdns to clear local cache

17. CNAME Record Limitations and Restrictions

  • Cannot use CNAME for root domains (use ALIAS instead)
  • Conflicts with MX records (affects email routing)

18. How CNAME Records Affect SEO

  • Duplicate content risks from improper canonicalization
  • Proper CNAME usage helps in domain branding

19. Automating CNAME Management

  • Use cPanel API for programmatic DNS updates
  • Utilize bulk DNS tools for larger setups

20. Conclusion

A well-configured CNAME record simplifies domain management, improves reliability, and enhances flexibility for website administrators. Following best practices ensures that DNS configurations remain efficient, secure, and optimized for performance.

Important Note:

DNS changes may take up to 24-48 hours to propagate globally. Always verify changes using DNS lookup tools after making modifications.

case studies

See More Case Studies