Suped

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

14 marketer 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.

8 Aug 2024 - 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.

21 Nov 2021 - Linode Docs

What the experts say

2 expert 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.

15 Jul 2024 - 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.

2 Apr 2025 - Word to the Wise

What the documentation says

5 technical 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.

2 Dec 2022 - 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.

16 Aug 2024 - Microsoft

Start improving your email deliverability today

Sign up