Any DNS Modules?

Patrick Phalen python-list at teleo.net
Wed Oct 20 17:21:56 EDT 1999


[Amit Patel, on Wed, 20 Oct 1999]:
:: Guido van Rossum  <guido at cnri.reston.va.us> wrote:
:: | 
:: | The DNS package is listed on the Python website (follow the Modules
:: | link in the top bar).  Does nobody use that?  Searching python.org
:: | for DNS would also have brought this up.
:: | 
:: 
:: I've looked at it but I never figured out how to use it.  :-( If I
:: knew the DNS protocol (things like "MF", "WKS", "MX", "AXFR", ...) I
:: would probably be able to figure out what the DNS package does, but I
:: don't really know much about DNS -- all I want to do is turn hostnames
:: into IP addresses and IP addresses into hostnames.  All this stuff
:: about transfer functions and classes and types and building records is
:: just too much for me.  (I currently use socket.* functions for that
:: but I wanted something asynchronous.. so that's why I looked at the
:: DNS package.)

Sounds like you want to familiarize yourself with nslookup, which you
can access via os.popen()  -- from Unix at least.

e.g.:
>>> import os
>>> f = os.popen('nslookup python.org').readlines()




More information about the Python-list mailing list