mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-11 00:31:56 -06:00
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
This commit is contained in:
parent
ebfda866dd
commit
c16c257145
@ -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'))
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user