Domains

How to Configure A and CNAME DNS Records for Your Domain

Learn how to edit your domain's A and CNAME records to point to any server or service in just a few minutes.

A modern server room featuring network equipment with blue illumination. Ideal for technology themes.

To point your domain to a server or activate an external service (Google Workspace, Shopify, Vercel, etc.), you need to edit two types of DNS records: the A record and the CNAME record. This guide explains exactly what each one does and how to configure them.

What Are A and CNAME Records?

DNS records are public instructions that tell the internet where to send traffic for your domain. Each record type serves a different purpose:

  • A Record (Address): maps a domain name to an IPv4 address. It's the most fundamental record and directly points your domain to your server's IP.
  • CNAME Record (Canonical Name): maps a domain name to another domain name. It's used for subdomains or aliases — never for the root domain (@).

Simply put: an A record connects a name to an IP; a CNAME connects a name to another name.

Key Differences Between A Records and CNAMEs

Feature A Record CNAME Record
Points to IPv4 address (e.g. 203.0.113.10) Another domain name (e.g. myapp.vercel.app)
Used on Root domain (@) and subdomains Subdomains only (www, blog, shop…)
When destination changes You must update the IP manually Provider updates the IP; CNAME stays valid
Example use Point yourdomain.com to your VPS Point www.yourdomain.com to Shopify

When to Use Each Record Type

Use an A record when…

  • You want to point the root domain (yourdomain.com) to your hosting's IP address.
  • Your provider gives you a static IP address.
  • You need to point both the root domain and a subdomain to the same IP.

Use a CNAME record when…

  • A service provider (Shopify, HubSpot, Vercel, Netlify) asks you to point www or a subdomain to their domain.
  • You want a subdomain to follow the service automatically if its IP changes.
  • You're verifying your domain in Google Search Console or Google Workspace.

Practical rule: A CNAME cannot coexist with other records at the same name. If you need MX or TXT records at the root domain, use an A record instead of a CNAME.

How to Edit DNS Records in cPanel Step by Step

Most web hosting control panels use cPanel. Follow these steps:

  1. Log in to your cPanel (usually at yourdomain.com/cpanel).
  2. Under the Domains section, click Zone Editor.
  3. Find the domain you want to edit and click Manage.
  4. You'll see a list of current records. To add a new one, click Add Record.

Creating an A Record

  1. In the Name field, enter @ (for the root domain) or a subdomain name (e.g. store).
  2. Set Type to A.
  3. Leave TTL at the default (3600 seconds), or set it to 300 if you want changes to take effect faster.
  4. In Record, enter your server's IPv4 address (e.g. 203.0.113.10).
  5. Click Save Record.

Creating a CNAME Record

  1. In Name, enter the subdomain (e.g. www or blog).
  2. Set Type to CNAME.
  3. In Record, enter the target domain your provider specified (e.g. stores.myshopify.com). Add a trailing dot if the panel requires it, or leave it off if not.
  4. Click Save Record.

How to Edit DNS Records in Cloudflare

If your domain uses Cloudflare nameservers (recommended for speed and security), the process is similar:

  1. Go to dash.cloudflare.com and select your domain.
  2. Navigate to DNS → Records.
  3. Click Add Record.
  4. Choose the type (A or CNAME), fill in the name and value, and save.

Important in Cloudflare: you'll see an orange cloud icon (proxy enabled) or a grey cloud (DNS only). For external services like Shopify or Vercel, disable the proxy (grey cloud) on the CNAME, otherwise the provider's SSL won't work correctly.

If you're looking for reliable hosting with an easy DNS interface, elenlace.com offers plans with cPanel and intuitive DNS zone management.

DNS Propagation Times

After saving a record, changes don't take effect instantly. The TTL (Time To Live) determines how long propagation takes:

  • TTL 300 (5 min): changes visible within 5–30 minutes for most users.
  • TTL 3600 (1 hour): full propagation in 1–4 hours.
  • TTL 86400 (24 hours): can take up to 48 hours to propagate globally.

You can verify propagation status at dnschecker.org or by running dig yourdomain.com A in your terminal.

For more articles on DNS zones and domain configuration, visit our domains blog.

Common Mistakes When Configuring DNS Records

  • CNAME at the root domain: technically invalid (RFC 1912). Some panels allow it but it breaks MX records. Always use an A record for @.
  • Wrong IP in the A record: double-check the IP in your hosting control panel — don't assume it's the same as last year.
  • Not deleting the old record: if you have two A records for the same name with different IPs, traffic will split unpredictably. Delete the obsolete one.
  • Missing trailing dot in CNAME: some zone editors (BIND) require a trailing dot in the value (stores.myshopify.com.). cPanel and Cloudflare add it automatically.

Key Takeaways

  • An A record maps a domain name to an IPv4 address; use it for the root domain and when the destination is a fixed IP.
  • A CNAME record maps a subdomain to another domain name; use it for www and subdomains of external services.
  • Never put a CNAME at the root domain (@) if you also need MX or TXT records.
  • Lower the TTL to 300 seconds before making important changes so propagation is faster.
  • In Cloudflare, disable the proxy (grey cloud) on CNAMEs pointing to services with their own SSL.
  • Always verify with dig or dnschecker.org after saving.

Ready to configure your domain's DNS with confidence? The team at elenlace.com can handle all the technical DNS setup so your site goes live without a hitch.

FAQ

Can I have both an A record and a CNAME for the same name?

No. A domain name can only have one resolution record type (A, AAAA, or CNAME). If you try to create a CNAME where an A record already exists (or vice versa), the panel will throw an error or behavior will be unpredictable. Choose one based on your needs.

How long does it take for an A record change to take effect?

It depends on the TTL in place at the time of the change. If the TTL was 3600 seconds, cached DNS servers can take up to an hour to update. For urgent changes, reduce the TTL to 300 at least 24 hours before making the modification.

What happens if I point a CNAME to a domain that doesn't exist?

Visitors will receive a DNS error (NXDOMAIN). The browser will display something like "This site can't be reached." Always verify the target domain is active before saving the CNAME.

Can I use a CNAME for the root domain in Cloudflare?

Cloudflare offers a feature called CNAME Flattening that internally converts the root CNAME into A records, solving the compatibility issue. This is a Cloudflare-specific extension and is not available in all DNS panels.

Further reading

Other providers and guides worth comparing:

← All