Commit 78f2fe21 authored by Michael Kroes's avatar Michael Kroes Committed by Joshua Tauberer

Secondary name server could not be set (#1209)

parent a16855ec
......@@ -764,12 +764,12 @@ def set_custom_dns_record(qname, rtype, value, action, env):
if qname != "_secondary_nameserver":
raise ValueError("%s is not a domain name or a subdomain of a domain name managed by this box." % qname)
if not re.search(DOMAIN_RE, qname):
raise ValueError("Invalid name.")
# validate rtype
rtype = rtype.upper()
if value is not None and qname != "_secondary_nameserver":
if not re.search(DOMAIN_RE, qname):
raise ValueError("Invalid name.")
if rtype in ("A", "AAAA"):
if value != "local": # "local" is a special flag for us
v = ipaddress.ip_address(value) # raises a ValueError if there's a problem
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment