From 21b00e8fbbd655369d53bdf34a84ea1156534467 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Tue, 3 Feb 2015 21:51:19 -0500 Subject: [PATCH] if a custom A record is set, dont put in a default AAAA record pointing to the box because it will probably be wrong --- the user should either set an AAAA record or let the domain not resolve on IPv6 --- management/dns_update.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/management/dns_update.py b/management/dns_update.py index 9925840f..331ab764 100755 --- a/management/dns_update.py +++ b/management/dns_update.py @@ -222,7 +222,11 @@ 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) and not has_rec(qname, "CNAME"): + # Set the default record, but not if: + # (1) there is not a user-set record of the same type already + # (2) there is not a CNAME record already, since you can't set both and who knows what takes precedence + # (2) there is not an A record already (if this is an A record this is a dup of (1), and if this is an AAAA record then don't set a default AAAA record if the user sets a custom A record, since the default wouldn't make sense and it should not resolve if the user doesn't provide a new AAAA record) + if not has_rec(qname, rtype) and not has_rec(qname, "CNAME") and not has_rec(qname, "A"): records.append((qname, rtype, value, explanation)) # Append the DKIM TXT record to the zone as generated by OpenDKIM.