Search code examples
pythonpython-2.7dnspython

dnspython 1.11.1 EmptyLabel exception in python 2.7.6


I just installed dnspython using "pip install dnspython". I then opened up a python shell and tried the following code:

import dns.resolver
answers = dns.resolver.query('dnspython.org', 'MX')

and am immediately getting the following:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "dns/resolver.py", line 973, in query
    return get_default_resolver().query(qname, rdtype, rdclass, tcp, source,
  File "dns/resolver.py", line 961, in get_default_resolver
    default_resolver = Resolver()
  File "dns/resolver.py", line 489, in __init__
    self.read_resolv_conf(filename)
  File "dns/resolver.py", line 540, in read_resolv_conf
    self.search.append(dns.name.from_text(suffix))
  File "dns/name.py", line 638, in from_text
    raise EmptyLabel
dns.name.EmptyLabel

I am on OSX Mavericks using python 2.7.6, pip version 1.5.4, and dnspython version 1.11.1


Solution

  • It looks like you might have some DNS issues locally or permissions issue. Can you make sure you have your network DNS pages setup correctly.