01-23-04 10:27 PM
Jeff Rodriguez <newsgroup1@gurugeek.EXAMPLENOSPAM.com> writes:
quote:
> Is there any way to specify what nameservers will be used when a call to
> gethostbyname is called? This must be done from within the code, not by
> modifying /etc/resolv.conf.
You don't say what kind of system you're using, but programs can
usually tweak the resolver's behavior by calling res_init() and
then modifying the global _res structure before calling any resolver
functions like gethostbyname(). _res is a struct __res_state, which
should be defined in <resolv.h>. The number of nameservers and
their IP addresses are in the nscount and nsaddr_list fields.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
[ Post a follow-up to this message ]
|