]> git.ipfire.org Git - oddments/ddns.git/commitdiff
resolve(): Handle non-existing DNS records.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Jun 2014 21:58:25 +0000 (23:58 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Jun 2014 21:58:25 +0000 (23:58 +0200)
src/ddns/system.py

index a071e489f1e5850367e150eb52135a8002770ef3..90226b3943963771d070251fe7e9c0afefc4442b 100644 (file)
@@ -194,7 +194,14 @@ class DDNSSystem(object):
                        raise ValueError("Protocol not supported: %s" % proto)
 
                # Resolve the host address.
-               response = socket.getaddrinfo(hostname, None, family)
+               try:
+                       response = socket.getaddrinfo(hostname, None, family)
+               except socket.gaierror, e:
+                       # Name or service not known
+                       if e.errno == -2:
+                               return []
+
+                       raise
 
                # Handle responses.
                for family, socktype, proto, canonname, sockaddr in response: