Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Python bindings for getdns

External dependencies

Built and tested against Python 2.7 and Python 3.4. You will need to install the Python headers and libraries - this is usually a package called "python-dev"

Currently building against the getdns v1.0.0b release. getdns external dependencies include:


To build,

python build 

During the development process and before the module is installed, I find it convenient to have a symlink in the current directory pointing to the library in the build directory. For example: -> build/lib.linux-i686-2.7/

This is only useful if you're working on the actual bindings code; people who are using the bindings should go ahead and install.

To install,

python install

We recently added Python 3 support. To build, just invoke the Python 3 interpreter rather the Python 2 interpreter (on most systems this will be "python3").

python3 build

You will need the Python 3 development environment ("python3-dev" or "python3-devel", most often).


Documentation is formatted using the sphinx documentation system. The html-formatted output is under the pygetdns source tree in doc/_build/html. It is also available online at [] (

Changes from the earlier release

  • A number of performance improvements.

  • Installable via PyPi.

  • Removed libevent dependency

  • For consistency with Python 3, the Python 2 bindings now return Context() attributes as longs

  • TSIG support

  • GETDNS_AUTHENTICATION_HOSTNAME is replaced by GETDNS_AUTHENTICATION_REQUIRED (but remains available as an alias). Upstreams can now be configured with either a hostname or a SPKI pinset for TLS authentication (or both). If the GETDNS_AUTHENTICATION_REQUIRED option is used at least one piece of authentication information must be configured for each upstream, and all the configured authentication information for an upstream must validate.

Older changes

In addition to adding Python 3 support, we've changed the callback argument to the asynchronous methods to accept a callable by name, rather than as a literal string.

We're also now supporting a new transport_list attribute, an ordered (by preference) list of transport options, including TCP, UDP, TLS, and STARTTLS.

There are also a number of bugfixes, including cleaning up after unbound zombies (this has been fixed in unbound as well but the code is not yet included in a distribution) and correct handling of strings encoded as getdns bindatas.

Examples have been updated to work with both Python 2.x and Python 3.

Please see the documentation for details on new attributes extensions, and methods.


There are several sample scripts in the examples directory, showing how to issue different kinds of queries, how to verify the answer status and DNSSEC status, and so on.