The PyDNS provides a module for performing DNS queries from python applications. It was originally based on Guido van Rossum's DNS library code, but has drifted further and further away from it over time.