diff --git a/mongodb_consistent_backup/Common/Util.py b/mongodb_consistent_backup/Common/Util.py index 5ad3e831..a2c4713a 100644 --- a/mongodb_consistent_backup/Common/Util.py +++ b/mongodb_consistent_backup/Common/Util.py @@ -25,6 +25,6 @@ def validate_hostname(hostname): try: if ":" in hostname: hostname, port = hostname.split(":") - socket.gethostbyname(hostname) + socket.getaddrinfo(hostname, None) except socket.error, e: raise OperationError("Could not resolve host '%s', error: %s" % (hostname, e))