From 3253a305416c963fcdc2670caa2c22c167ccc0d2 Mon Sep 17 00:00:00 2001 From: Ana Krivokapic Date: Tue, 12 Feb 2013 10:50:00 -0500 Subject: Add list of domains associated to our realm to cn=etc Add new LDAP container to store the list of domains associated with IPA realm. Add two new ipa commands (ipa realmdomains-show and ipa realmdomains-mod) to allow manipulation of the list of realm domains. Unit test file covering these new commands was added. https://fedorahosted.org/freeipa/ticket/2945 --- ipalib/util.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'ipalib/util.py') diff --git a/ipalib/util.py b/ipalib/util.py index a92e68c4..9ed27c84 100644 --- a/ipalib/util.py +++ b/ipalib/util.py @@ -105,6 +105,27 @@ def validate_host_dns(log, fqdn): ) raise errors.DNSNotARecordError() + +def has_soa_or_ns_record(domain): + """ + Checks to see if given domain has SOA or NS record. + Returns True or False. + """ + try: + resolver.query(domain, rdatatype.SOA) + soa_record_found = True + except DNSException: + soa_record_found = False + + try: + resolver.query(domain, rdatatype.NS) + ns_record_found = True + except DNSException: + ns_record_found = False + + return soa_record_found or ns_record_found + + def normalize_name(name): result = dict() components = name.split('@') -- cgit