diff --git a/CHANGELOG.md b/CHANGELOG.md index 54abdb7..2fd235f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ========= +Development +----------- + +DNS: + +* If a custom CNAME record is set, don't add a default A/AAAA record, e.g. for 'www', which end up preventing the CNAME record from working. + v0.06 (January 4, 2015) ----------------------- diff --git a/management/dns_update.py b/management/dns_update.py index 7c01f6d..cb0eb86 100755 --- a/management/dns_update.py +++ b/management/dns_update.py @@ -212,6 +212,7 @@ def build_zone(domain, all_domains, additional_records, env, is_zone=True): records.append((qname, rtype, value, "(Set by user.)")) # Add defaults if not overridden by the user's custom settings (and not otherwise configured). + # Any "CNAME" record on the qname overrides A and AAAA. defaults = [ (None, "A", env["PUBLIC_IP"], "Required. May have a different value. Sets the IP address that %s resolves to for web hosting and other services besides mail. The A record must be present but its value does not affect mail delivery." % domain), ("www", "A", env["PUBLIC_IP"], "Optional. Sets the IP address that www.%s resolves to, e.g. for web hosting." % domain), @@ -221,7 +222,7 @@ def build_zone(domain, all_domains, additional_records, env, is_zone=True): for qname, rtype, value, explanation in defaults: if value is None or value.strip() == "": continue # skip IPV6 if not set if not is_zone and qname == "www": continue # don't create any default 'www' subdomains on what are themselves subdomains - if not has_rec(qname, rtype): + if not has_rec(qname, rtype) and not has_rec(qname, "CNAME"): records.append((qname, rtype, value, explanation)) # Append the DKIM TXT record to the zone as generated by OpenDKIM.