When setting up a subdomain, what A record should I use, and when should I use a CNAME?

Summary

When setting up a subdomain, the decision between an A record and a CNAME record hinges on the subdomain's purpose. A records directly link the subdomain to a specific, static IP address, suitable for self-hosted websites or services where direct control is needed. CNAME records, conversely, link the subdomain to another domain name, offering flexibility when the underlying IP address might change, especially for third-party services like ESPs or CDNs. For email subdomains, CNAMEs are generally preferred, letting the service provider handle IP management for deliverability. A records are important for primary websites or self-managed servers, while CNAMEs simplify management and accommodate dynamic infrastructures.

Key findings

  • A Record Purpose: A records map a subdomain directly to a static IP address, suitable for direct control and self-hosted services.
  • CNAME Purpose: CNAME records map a subdomain to another domain name, providing flexibility when the IP address might change or for third-party services.
  • Email Subdomain Recommendation: For email sending subdomains, CNAME records are preferred to allow the ESP to manage IP addresses.
  • Flexibility and Simplified Management: CNAMEs offer flexibility for dynamic infrastructures and simplify management by avoiding manual IP address updates.

Key considerations

  • IP Address Stability: Determine whether the IP address of the target service is static or might change.
  • Third-Party Service Instructions: Follow instructions provided by third-party service providers (e.g., ESPs, CDNs) regarding DNS settings.
  • Direct Control Requirement: Assess the level of direct control needed over the IP address mapping.
  • DNS Update Management: Consider the ease of DNS updates when IP addresses change.
  • Avoiding non-contractual IP addresses: Never point directly to an IP address you don't own or have a contractual agreement to use.

What email marketers say
14Marketer opinions

When setting up a subdomain, the choice between using an A record and a CNAME record depends on the intended purpose and infrastructure of the subdomain. A records directly map the subdomain to a specific IP address, making them suitable for web servers or services with static IPs. CNAME records, on the other hand, map the subdomain to another domain name, providing flexibility for services that may change IP addresses or are managed by third-party providers like CDNs or ESPs. For email sending, CNAME records pointing to your ESP are commonly recommended, while A records are often preferred for primary websites or services you directly control.

Key opinions

  • A Record Use Case: A records are best for pointing a subdomain to a specific, static IP address, such as a web server.
  • CNAME Use Case: CNAME records are ideal for pointing a subdomain to a third-party service or another domain name, especially where the underlying IP address may change.
  • Email Subdomains: For email sending subdomains, CNAME records pointing to your email service provider (ESP) are generally recommended.
  • Flexibility of CNAME: CNAME records offer flexibility, allowing the service provider to manage the underlying infrastructure without requiring frequent DNS updates.

Key considerations

  • Static vs. Dynamic IPs: If the service has a static IP address, an A record can be used. If the IP address may change, a CNAME is more flexible.
  • Third-Party Services: If the subdomain points to a third-party service (e.g., ESP, CDN), follow the service provider's instructions, which often involve using a CNAME record.
  • Website Redirection: Consider redirecting the subdomain to the main website or another relevant page for user experience.
  • ESP Documentation: Always consult the documentation of your email service provider (ESP) or hosting provider for specific DNS record configuration instructions.
Marketer view

Marketer from Email Geeks explains that even if you want to use the subdomain for email tracking, ESPs will probably ask for a CNAME, not an A record. This would have to be a sub-domain of this subdomain (like t.investors.audiencepoint.com), because you can't have a CNAME along with any other record at the same level.

October 2022 - Email Geeks
Marketer view

Email marketer from Linode Docs responds when you use a CNAME, you can point a subdomain to another domain name. This is helpful if the IP address of the target resource changes over time. If a service you use makes an IP change, you don't have to update DNS records directly; only the record for the canonical name needs to be changed.

August 2023 - Linode Docs
Marketer view

Marketer from Email Geeks shares that ESP documentation usually has exactly how to do and what to point to. Even the setup process will guide you as you set up, including what to put in DNS.

September 2024 - Email Geeks
Marketer view

Marketer from Email Geeks explains that if an A record is required, use the IP of one of your web servers and to never let your domain name point to something you don't own or have a contractual relation with.

March 2021 - Email Geeks
Marketer view

Email marketer from Webmaster World explains CNAME records are often used to point a subdomain to a third-party service, such as a content delivery network (CDN) or an email marketing platform. The CNAME would point to the service's domain, and the service manages the underlying IP address. This allows the service to change its infrastructure without requiring you to update your DNS records.

January 2022 - Webmaster World
Marketer view

Email marketer from GoDaddy Help responds if your domain name or subdomain needs to resolve to a static IP address, use an A record. This tells the internet where to find the server hosting your website or application.

August 2023 - GoDaddy Help
Marketer view

Email marketer from DNSimple explains that A records are for pointing your domain or subdomain directly to an IP address. CNAME records point your domain or subdomain to another domain name. Use A records for your primary website and CNAME records for services or applications that might change locations.

May 2024 - DNSimple Support
Marketer view

Email marketer from Name.com Support explains if your hosting provider instructs you to use a CNAME record to connect your domain to their servers, follow their instructions. They use CNAMEs for flexibility and to manage their infrastructure without you needing to update your DNS settings frequently.

July 2021 - Name.com Support
Marketer view

Email marketer from Hostinger Tutorials suggests you should typically use an A record for your primary domain to point to your web server's IP. Then, use CNAME records for subdomains (like blog.example.com or shop.example.com) to point to specific services or applications.

February 2024 - Hostinger Tutorials
Marketer view

Marketer from Email Geeks shares that ideally, the subdomain should point to your website, and your website would redirect from the subdomain to www or something.

July 2023 - Email Geeks
Marketer view

Email marketer from Cloudns responds that CNAMEs allow for more flexibility when the target resource changes IP addresses. Instead of updating the A record, only the target domain's IP needs to be updated. This is useful for content delivery networks (CDNs) or cloud services, where the underlying infrastructure may change.

August 2023 - Cloudns
Marketer view

Email marketer from Namecheap responds if you have a website hosted on a server with a dedicated IP address, you need to create an A record to point your domain or subdomain to that IP. This tells browsers where to find your website's files.

January 2025 - Namecheap
Marketer view

Email marketer from Stack Overflow shares that A records are typically used for the main domain or subdomains that need a direct IP address, like a web server. If your subdomain hosts a website, it will likely need an A record pointing to the server's IP.

January 2022 - Stack Overflow
Marketer view

Email marketer from Reddit shares when setting up a subdomain for email marketing (e.g., mail.example.com), you'll typically use a CNAME record to point it to your email service provider (ESP). The ESP will provide the target domain for the CNAME record. This allows them to handle the technical details of routing your email.

October 2022 - Reddit

What the experts say
2Expert opinions

Experts agree that when configuring a subdomain for specific services, especially email, using a CNAME record is the best practice. This allows the service provider (like an ESP) to manage the underlying IP addresses and infrastructure, ensuring flexibility and simplifying DNS management. By using a CNAME, you avoid the need to update your DNS settings manually whenever the service's IP changes, which is critical for maintaining deliverability and avoiding technical complexities.

Key opinions

  • CNAME for Email Subdomains: For email sending subdomains, using a CNAME record to point to your email service provider (ESP) is the recommended approach.
  • Service Provider Management: CNAME records allow the service provider to manage the underlying IP addresses and infrastructure.
  • Simplified DNS Management: Using a CNAME simplifies DNS management, as you don't need to update DNS settings manually when the service's IP changes.
  • Flexibility: CNAME records are more flexible for services that may change locations or IP addresses.

Key considerations

  • Specific Service Subdomains: Consider using CNAME records for subdomains dedicated to specific services like email or CDNs.
  • IP Address Management: Ensure the service provider manages the underlying IP addresses and infrastructure when using CNAME records.
  • Avoid Manual Updates: Using CNAME records helps avoid the need for manual DNS updates when service IP addresses change.
  • Deliverability: Using correct DNS records like CNAME records can improve your email deliverability.
Expert view

Expert from SpamResource explains that when setting up a subdomain for email sending (e.g., mail.example.com), it's best practice to use a CNAME record to point it to your email service provider (ESP). The ESP manages the A records, handling IP changes and infrastructure. This is crucial for maintaining deliverability and avoiding technical complexities.

July 2021 - SpamResource
Expert view

Expert from Word to the Wise responds if you are setting up a subdomain for a specific service, like email or a CDN, use a CNAME record. The service provider will manage the underlying IP addresses, and you won't need to update your DNS settings every time the service's IP changes. CNAME records are more flexible for services that may change locations.

May 2023 - Word to the Wise

What the documentation says
5Technical articles

Documentation consistently states that A records map a domain or subdomain directly to an IPv4 address, suitable for static IP addresses and direct control. CNAME records, conversely, map a domain or subdomain to another domain name (the canonical name). CNAMEs are advantageous for aliasing domains, managing updates, and services hosted externally or subject to IP address changes. The choice hinges on whether you require a direct mapping to an IP or a more flexible alias to another domain.

Key findings

  • A Record Definition: A records map a domain/subdomain to an IPv4 address.
  • CNAME Definition: CNAME records map a domain/subdomain to another domain name (canonical name).
  • A Record Use Case: Use A records for static IP addresses and direct control over domain-to-IP mapping.
  • CNAME Use Case: Use CNAME records for aliasing domains, managing updates, and services hosted externally with potential IP changes.

Key considerations

  • Static vs. Dynamic IPs: Assess whether the service/resource has a static IP or is subject to change.
  • Control Requirements: Determine the level of control needed over the domain-to-IP mapping.
  • External Services: Consider CNAME records for services hosted externally, where IP addresses may be managed by the service provider.
  • Manual Updates: Be aware that A records require manual updates if the IP address changes.
Technical article

Documentation from AWS Route 53 explains A records point a domain name to an IPv4 address. CNAME records, on the other hand, point a domain name to another domain name. The choice depends on whether you need to point directly to an IP or to another domain name that might change IPs.

December 2021 - Amazon Web Services
Technical article

Documentation from Microsoft explains A records map a domain name to an IPv4 address, which is suitable for websites and services hosted on Azure Virtual Machines or other resources with a static IP. CNAME records map a domain name to another domain name. Use CNAME records for services hosted elsewhere that might change IP addresses, or for load balancing scenarios. This is helpful for email delivery when using external services.

May 2021 - Microsoft
Technical article

Documentation from Cloudflare explains that an A record maps a domain name to an IPv4 address, while a CNAME record maps an alias domain name to a canonical domain name. Use A records when you need to point your domain or subdomain directly to an IP address. Use CNAME records when you want to alias one domain to another, allowing for easier management and updates.

January 2024 - Cloudflare
Technical article

Documentation from DigitalOcean explains A records directly map a domain to an IPv4 address. If the IP address of your server changes, you must update the A record manually. A records are suitable for scenarios where you have a static IP address and want direct control over the domain-to-IP mapping.

November 2022 - DigitalOcean
Technical article

Documentation from Google Domains Help answers that a CNAME record maps an alias domain name to another (the canonical) domain name. This is useful for mapping multiple subdomains (like www, blog, shop) to a single website domain. If the target domain's IP address changes, the CNAME record automatically updates, ensuring the subdomain continues to point to the correct resource.

September 2022 - Google Domains Help