How to specify a name server in user program

David Botham DBotham at
Wed Nov 24 18:05:16 UTC 2004

bind-users-bounce at wrote on 11/24/2004 05:46:20 AM:
> 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 then I would like to set the
> nameserver as If I am querying for then I
> would like to set the nameserver as 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?

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 



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

More information about the bind-users mailing list