How to specify a name server in user program

How to specify a name server in user program

Post by nishant8 » Thu, 25 Nov 2004 19:46:20


Hello all,
I need to write a program to contact multiple name servers. The
selection of a name server should be done based on the domain in which
the host lies.

For example:
If I am quering for abc.example.com then I would like to set the
nameserver as 10.53.0.1. If I am querying for xyz.example.com then I
would like to set the nameserver as 10.53.0.2 and so on.

My question is:
Is there any way of doing such a thing in the program without
disturbing the resolv.conf file? Or in other words,
Is there any API provided to set the name server's IP address in a
user program?

Any kind of help is most welcome. Thnx in advance,
Nishant
 
 
 

How to specify a name server in user program

Post by David Both » Fri, 26 Nov 2004 03:05:16


XXXX@XXXXX.COM wrote on 11/24/2004 05:46:20 AM:

Perl's NET::DNS module provides a pretty flexible interface for this type
of programming and would be able to accomplish what you have described
above.


hth,

Dave...

 
 
 

How to specify a name server in user program

Post by phn » Fri, 26 Nov 2004 03:29:26


Get a new strategy. The described schenario won't be maintainable. DNS
assumes thers is one root and that Internet looks the same wherever you ask.



--
Peter Hanson
IPSec Sverige ( At Gothenburg Riverside )
Sorry about my e-mail address, but i'm trying to keep spam out,
remove "icke-reklam" if you feel for mailing me. Thanx.