summaryrefslogtreecommitdiffstats
path: root/ipapython/ipautil.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipapython/ipautil.py')
-rw-r--r--ipapython/ipautil.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index e76d87d3..c444d8c9 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -810,6 +810,19 @@ def is_host_resolvable(fqdn):
return False
+def host_exists(host):
+ """
+ Resolve the host to see if it exists.
+
+ Returns True/False
+ """
+ try:
+ socket.getaddrinfo(host, 80)
+ except socket.gaierror:
+ return False
+ else:
+ return True
+
def get_ipa_basedn(conn):
"""
Get base DN of IPA suffix in given LDAP server.