How to find out DNS ?

Gerhard Häring gerhard.haering at gmx.de
Thu Jun 27 13:33:32 EDT 2002


A wrote in comp.lang.python:
> Hi,
> Is there a way how to find out, from Python , what primary or 
> secondary DNS I use when connecting to internet?

I don't think so. There might be platform specific ways to get that
info, though. On Unixen, for example, you can parse /etc/resolv.conf
for lines starting with "nameserver".

On Windows, your best bet is to read MSDN on how to do it and try to
get that info with the win32 extensions.

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9  3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))



More information about the Python-list mailing list