diff options
author | Martin Kosek <mkosek@redhat.com> | 2012-09-25 10:36:01 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-09-26 13:44:11 +0200 |
commit | c49bc80494938a41d2c34c7ac1cde1fe3a14ddd5 (patch) | |
tree | d184696f792b1966373604157c2cc916b6940d4b /ipalib/util.py | |
parent | ba5248135c0ca9d64deddc9d11ea1a606d87bc27 (diff) | |
download | freeipa-c49bc80494938a41d2c34c7ac1cde1fe3a14ddd5.tar.gz freeipa-c49bc80494938a41d2c34c7ac1cde1fe3a14ddd5.tar.xz freeipa-c49bc80494938a41d2c34c7ac1cde1fe3a14ddd5.zip |
Use custom zonemgr for reverse zones
When DNS is being installed during ipa-{server,dns,replica}-install,
forward and reverse zone is created. However, reverse zone was always
created with default zonemgr even when a custom zonemgr was passed
to the installer as this functionality was missing in function
creating reverse zone.
Consolidate functions creating forward and reverse zones to avoid
code duplication and errors like this one. Reverse zones are now
created with custom zonemgr (when entered by user).
https://fedorahosted.org/freeipa/ticket/2790
Diffstat (limited to 'ipalib/util.py')
-rw-r--r-- | ipalib/util.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ipalib/util.py b/ipalib/util.py index df8791ba0..53b6c80c5 100644 --- a/ipalib/util.py +++ b/ipalib/util.py @@ -494,6 +494,19 @@ def get_dns_reverse_zone_update_policy(realm, reverse_zone, rrtypes=('PTR',)): return policy +# dictionary of valid reverse zone -> number of address components +REVERSE_DNS_ZONES = { + '.in-addr.arpa.' : 4, + '.ip6.arpa.' : 32, +} + +def zone_is_reverse(zone_name): + zone_name = normalize_zone(zone_name) + if any(zone_name.endswith(name) for name in REVERSE_DNS_ZONES): + return True + + return False + def get_reverse_zone_default(ip_address): ip = netaddr.IPAddress(ip_address) items = ip.reverse_dns.split('.') |