[Python-Dev] Proposed DNS query library

John D. lists@webcrunchers.com
Sat, 28 Jun 2003 19:53:43 -0700


Python has everything else, but it doesn't have a nameserver lookup class.
I propose creating a library which will perform the equivalent of the "dig" or "nslookup" commands. My own application is using it to query a DNS for mx records as a preface to using smtplib. (Perhaps this should be added to smtplib?)

dnslib? diglib? domainlib? nslookuplib?

Possibly:
servers=dnsquery([nameserver],[name],[type],[class])
i.e.
>>>from dnslib import dnsquery
>>>d=dnsquery(,"google.com","mx")
>>>print d
['10 smtp1.google.com','20 smtp2.google.com']

It would have the usual options, etc.

Is this a good idea or do I need to spend more time in the oven?
(or worse, it already exists and I overlooked it?)