When setting up a subdomain, choosing between an A record and a CNAME record is a fundamental decision that impacts how your subdomain resolves and functions, especially for email sending. An A record directly maps a domain or subdomain to an IP address, while a CNAME record creates an alias that points to another domain name. Understanding the implications of each, particularly the rule that a CNAME record cannot coexist with other records at the same level, is crucial for proper DNS configuration and smooth email deliverability.
Key findings
Direct mapping: An A record directly links a subdomain to a specific IPv4 address. This means if the IP address changes, the A record must be manually updated.
Alias function: A CNAME record (Canonical Name) serves as an alias, pointing a subdomain to another domain name rather than directly to an IP address.
CNAME restriction: A critical DNS rule dictates that if a CNAME record exists for a subdomain, no other DNS records (such as A, MX, or TXT records like SPF or DMARC) can exist for that same subdomain name at the same level.
Email sending: For email sending and tracking, many Email Service Providers (ESPs) recommend or require CNAME records for subdomains, as it allows them to manage the underlying IP addresses dynamically without requiring you to update your DNS records manually.
Key considerations
DNS interface requirements: Your DNS management interface may impose specific requirements or default behaviors, influencing whether you initially set up an A record or a CNAME for a subdomain. Some interfaces may require an A record even if it will eventually be aliased.
Purpose of the subdomain: The choice heavily depends on the subdomain's primary function. If it's for a website with a stable IP, an A record might suffice. For email sending, tracking, or other services managed by a third-party (like an ESP), a CNAME is often more appropriate. For more on setting up email subdomains, see how to set up email subdomains.
Future flexibility: CNAMEs offer greater flexibility because if the underlying IP address of the target domain changes, you do not need to update your DNS record; the alias automatically resolves to the new IP. This is especially beneficial for services that frequently update their infrastructure.
DNS coexistence: Remember that a subdomain cannot have both a CNAME record and other record types (like A or MX records) simultaneously for the same hostname. This means if your ESP requires a CNAME for email.yourdomain.com, you cannot also have an A record or an MX record directly on email.yourdomain.com. Consider configuring CNAME records for subdomains to avoid conflicts. For more on DNS requirements, see what DNS records are needed for email sending subdomains.
What email marketers say
Email marketers often navigate DNS settings based on the requirements of their Email Service Providers. While some DNS interfaces might default to or require an A record initially, the consensus for email-specific subdomains, particularly for tracking or dedicated sending, leans towards CNAME records due to their flexibility and ease of management when IPs change. Marketers also emphasize the importance of ensuring any A record points to an owned or controlled server and the critical understanding of CNAME limitations, like the inability to coexist with other record types for the same hostname.
Key opinions
ESP guidance: Many marketers primarily rely on their ESP's instructions for setting up DNS records for subdomains, as ESPs typically provide exact CNAMEs or other records needed for proper functionality.
Tracking CNAMEs: CNAME records are widely used for email tracking subdomains (e.g., t.yourdomain.com) as they allow ESPs to manage redirects without needing direct IP configuration.
A record purpose: If an A record is required by a DNS management interface, marketers suggest pointing it to a web server you control, even if the subdomain's primary purpose is email sending or tracking via a CNAME on a sub-subdomain.
Subdomain purpose: The choice between an A record and a CNAME often comes down to the intended use of the subdomain; A records for direct IP connections, CNAMEs for aliasing to other domains or services. For more on this, check out why use email subdomains.
Key considerations
Coexistence rule: Marketers must be aware that a CNAME record cannot coexist with any other record types (A, MX, TXT) for the same hostname. This necessitates careful planning of subdomain structure if both web hosting and email functionalities are desired.
DNS setup complexity: While ESPs simplify the process, understanding the underlying DNS principles helps in troubleshooting and advanced configurations, such as when dealing with SPF authentication issues with multiple ESPs or subdomains.
Redirection strategy: If an A record is set for a subdomain that is not intended for web content, it is good practice to configure the web server to redirect that subdomain to the primary domain (e.g., from investors.yourdomain.com to www.yourdomain.com). This ensures a consistent user experience.
CNAME for email tracking: The use of CNAME records for email tracking offers an advantage by simplifying the management of multiple subdomains without needing to create A records for each. This is discussed in a guide to DNS CNAME records.
Marketer view
An email marketer from Email Geeks states that when setting up a new sending domain like investors.audiencepoint.com, it typically requires an A record.
29 May 2021 - Email Geeks
Marketer view
A marketer from Quora indicates that it would be best to have an A record for a specific subdomain, but notes that CNAMEs often force additional DNS queries, which can slightly impact performance.
22 Jun 2023 - Quora
What the experts say
Experts in email deliverability and DNS management stress the fundamental DNS rule that a CNAME record cannot coexist with other record types for the same hostname. They advise using A records only when direct IP mapping is necessary and controlled, otherwise opting for CNAMEs when integrating with third-party services like ESPs, which simplifies management. The importance of proper ownership of the IP address an A record points to is also frequently highlighted to maintain control and avoid potential deliverability issues.
Key opinions
CNAME rule: Experts consistently point out the critical DNS rule: you cannot have a CNAME record for a subdomain if there are any other records (like A or MX records) at that same level for the same subdomain name.
ESP requirements: ESPs typically guide users to set up specific CNAMEs for email sending and tracking domains, making these the preferred record type for integrating with their services.
A record use: If an A record is required by your DNS system, experts recommend pointing it to an IP address that you own or have a clear contractual relationship with, such as one of your web servers.
Ownership importance: Never point your domain or subdomain to an IP address you do not own or control, as this can lead to security vulnerabilities or loss of control over the domain.
Key considerations
DNS hierarchy: If you need a CNAME for email tracking on investors.domain.com, but your DNS provider also requires an A record for investors.domain.com, you might need to use a sub-subdomain for the CNAME (e.g., t.investors.domain.com) to avoid conflicts. This helps maintain your DNS records like SPF, DKIM, and DMARC.
Deliverability impact: Incorrect or conflicting DNS records, whether A records or CNAMEs, can severely impact email deliverability by causing authentication failures or resolution issues. Regular auditing of DNS records is essential.
Postmaster tools: When setting up subdomains for email, ensure that DNS records align with the requirements of major mailbox providers. Using tools like SpamResource can provide insights into deliverability issues related to DNS.
steve589 from Email Geeks questions the necessity of an A record for a sending subdomain, suggesting it might be a requirement of the DNS management interface rather than a deliverability need.
29 May 2021 - Email Geeks
Expert view
An expert from SpamResource highlights that misconfigured DNS records, particularly A records or CNAMEs, can significantly impact email deliverability and sender reputation, leading to blocklisting.
14 Nov 2023 - SpamResource
What the documentation says
Official documentation and technical guides provide clear definitions and usage rules for A records and CNAME records within the DNS system. They consistently highlight that an A record maps a hostname to an IPv4 address, while a CNAME record establishes an alias to another canonical domain name. A crucial point emphasized is the DNS standard dictating that a hostname with a CNAME record cannot have any other resource records at the same level. This fundamental rule guides how subdomains are configured, especially when integrating with various online services.
Key findings
A record definition: Documentation defines an A record as a DNS record type that maps a domain name or subdomain to an IPv4 address, which is a numerical address used to identify a device on the internet.
CNAME definition: A CNAME record, or Canonical Name record, is used to create an alias, pointing one domain or subdomain to another domain name. This is particularly useful for services that may change their underlying IP addresses frequently.
The CNAME rule: A core principle in DNS is that if a CNAME record is configured for a specific name, no other resource records (e.g., A, MX, TXT) can exist for that exact same name. This prevents ambiguous resolution.
Common use cases: CNAMEs are often used for subdomains to point to web hosts or other services that require or provide a canonical name, streamlining DNS management. For more on DNS lookups, see best practices for DNS lookups.
Key considerations
RFC adherence: DNS records, including A and CNAMEs, must adhere to the specifications outlined in relevant RFCs (Request for Comments) to ensure proper resolution across the internet.
Service integration: When integrating a subdomain with a third-party service, always consult their specific documentation regarding DNS requirements. They will specify whether an A record, CNAME, or other record types are needed.
Avoiding conflicts: To prevent DNS resolution errors or conflicts, avoid placing an A record on a subdomain that already has a CNAME record. This is a common source of DNS troubleshooting, similar to issues causing SPF DNS timeouts with Microsoft.
Subdomain creation: Platforms like Cloudflare allow users to choose between A, AAAA, or CNAME record types when creating subdomain records, depending on whether they need to point to an IPv4 address, IPv6 address, or another domain. For detailed instructions, refer to Cloudflare's guide on creating subdomain records.
Technical article
Cloudflare documentation states that A, AAAA, or CNAME can be selected as the record Type when creating subdomain records, depending on whether it needs to point to an IPv4, IPv6, or another domain.
20 Jan 2024 - Cloudflare Docs
Technical article
The IONOS help guide explains that a CNAME record serves as an alias for a subdomain, redirecting DNS queries to the canonical name and simplifying updates.