how to ask different DNS for gethostbyname?

Martin v. Löwis loewis at informatik.hu-berlin.de
Wed Mar 20 05:17:06 EST 2002


koji at twinsun.com (Koji Nobumoto) writes:

> Is there any way to use a DNS which is not looked up
> when I just use the socket.gethostbyname(),  without
> changing /etc/resolv.conf or any system configuration?

No. You need, at a minimum, access to the systems resolver library,
which is not exposed in standard Python. Better yet, you should use a
Python DNS package - that will allow you to use all tuning you want.

Regards,
Martin




More information about the Python-list mailing list