summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/dns.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/plugins/dns.py')
-rw-r--r--ipalib/plugins/dns.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index becec1423..d59df59a2 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -1841,6 +1841,18 @@ class dnszone_add(LDAPCreate):
dns_record,
nameserver_ip_address)
+ # Add entry to realmdomains
+ # except for our own domain, forwarded zones and reverse zones
+ zone = keys[0]
+
+ if (zone != api.env.domain
+ and not options.get('idnsforwarders')
+ and not zone_is_reverse(zone)):
+ try:
+ api.Command['realmdomains_mod'](add_domain=zone, force=True)
+ except errors.EmptyModlist:
+ pass
+
return dn
api.register(dnszone_add)
@@ -1857,6 +1869,17 @@ class dnszone_del(LDAPDelete):
force=True)
except errors.NotFound:
pass
+
+ # Delete entry from realmdomains
+ # except for our own domain
+ zone = keys[0]
+
+ if zone != api.env.domain:
+ try:
+ api.Command['realmdomains_mod'](del_domain=zone, force=True)
+ except errors.AttrValueNotFound:
+ pass
+
return True
api.register(dnszone_del)