A/AAAA or CNAME?

Introduction:

The Domain Name System (DNS) is simply the addressing system of the Internet.
On the other hand, DNS settings are specific to a domain.
My https://www.hostingtool.nl/ is a fairly unique tool that can turn orange for a detail.

What are A/AAAA and CNAME Records?

  • A/AAAA records: These records link a domain name directly to an IP address. A records are used for IPv4 addresses (for example, 192.0.2.1), while AAAA records are used for IPv6 addresses (for example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334).
  • CNAME records: This type of record is an alias that points to another domain name, which in turn is linked to an IP address via A/AAAA records. For example, if ‘alias.example.com’ has a CNAME record pointing to ‘via.example.com’, then ‘via.example.com’ resolves to an IP address via an A/AAAA record.
    Example: Suppose you have a website and a blog:
  • Website: www.mywebsite.nl -> 192.0.2.1 (A record)
  • Blog: blog.mywebsite.nl -> www.mywebsite.nl (CNAME record)
    Here ‘blog.mywebsite.nl’ refers via a CNAME to ‘www.mywebsite.nl’, which refers to the IP address 192.0.2.1 via an A record.
  • In consultation, AAAA is referred to as quad A.

Important aspects and explanations:

  1. RFC 1033 forbids the use of CNAME for the registered, apex domain:
    The apex domain is the main domain without subdomains, such as ‘example.com’.
    Use an A/AAAA record for an apex domain;
  2. CNAME affects subdomain email settings because MX and SPF cannot be set:
    A CNAME record can conflict with mail exchange (MX) and sender policy framework (SPF) records, which are essential for email configuration;
  3. Upcoming ANAME is flattened CNAME to just A/AAAA. Outsourced hosting can then be safe;
  4. The DNS based on RFCs, could benefit from a global authority: The RFC decision speed is not high enough;
  5. When moving www from CNAME to A/AAAA, the IPs should be checked carefully:
    Ensure that the new A/AAAA records correctly point to the correct IP address to avoid interruptions;
  6. For a server name such as www.example.com, e-mail from the server requires authorization:
    Ensure that emails sent from the server are properly authorized to be recognized as legitimate.
  7. In MX settings, ‘mail.example.com’ is more stable than ‘example.com’ because email traffic is not affected if the website is hosted elsewhere: Use specific subdomains for mail servers to ensure continuity of email services, regardless of where the website is hosted;
  8. In DMARC settings, CNAME can work as on https://dnsspy.io/scan/rijksoverheid.nl:
    DMARC records can use CNAME records for references;
  9. CNAME requires a little more search time:
    Because CNAME records must first be translated to another domain name before the IP address can be found, it takes a little longer to resolve a CNAME record compared to an A/AAAA record.

Conclusion:

When setting up DNS records, it is important to carefully choose between A/AAAA and CNAME records, depending on the specific needs of your domain and services. Correctly configuring these records contributes to the stable and efficient operation of your website and email services.