This fixes a regression in the recent DNS zone consolidation work.
-- Petr³
From 842a0bc8edda34b72976a0de2aade4a1ede5bfbb Mon Sep 17 00:00:00 2001 From: Petr Viktorin <[email protected]> Date: Thu, 27 Sep 2012 07:45:32 -0400 Subject: [PATCH] Fix NS records in installation Our installation added two final dots to the NS records, so the records were invalid, Bind ignored the entire zone, and name resolution didn't work. Fix this error and add a check for empty DNS labels to the validator --- ipalib/util.py | 3 +++ ipaserver/install/bindinstance.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ipalib/util.py b/ipalib/util.py index 53b6c80c5dbb4017536a1012771b37a0006e4d6d..ca14aee36b7ea8b6f00af19dfb207d6ab1f28e31 100644 --- a/ipalib/util.py +++ b/ipalib/util.py @@ -266,6 +266,9 @@ def validate_hostname(hostname, check_fqdn=True, allow_underscore=False): if hostname.endswith('.'): hostname = hostname[:-1] + if '..' in hostname: + raise ValueError(_('hostname contains empty label (consecutive dots)')) + if '.' not in hostname: if check_fqdn: raise ValueError(_('not fully qualified')) diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py index 9f6dca5253c4efcd3c9abcb6aa082e3986cab90a..f43a9ff0f9114388ae072daa82c39aaff716f7b2 100644 --- a/ipaserver/install/bindinstance.py +++ b/ipaserver/install/bindinstance.py @@ -326,7 +326,9 @@ def add_ptr_rr(zone, ip_address, fqdn, dns_backup=None): add_rr(zone, name, "PTR", fqdn+".", dns_backup) def add_ns_rr(zone, hostname, dns_backup=None, force=True): - add_rr(zone, "@", "NS", hostname+'.', dns_backup=dns_backup, + if not hostname.endswith('.'): + hostname += '.' + add_rr(zone, "@", "NS", hostname, dns_backup=dns_backup, force=force) def del_rr(zone, name, type, rdata): -- 1.7.11.4
_______________________________________________ Freeipa-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/freeipa-devel
