Talking to DNS

Joseph S D Yao jsdy at cospo.osis.gov
Tue Jan 18 22:37:10 UTC 2000


On Sun, Jan 09, 2000 at 12:35:08PM -0000, Dean Earley wrote:
> Does anyone know how to talk to a DNS server and get information back from
> it.
>   All I can find is what the server should reply with, but nothing about
> connection information, and query format.

It's not clear to me at what level you are talking.  Several people
have replied as if you wanted to write your own resolver routines.
However, if you are writing a program in C or PERL, you are best off
using the existing resolver routines.

If you are talking about via the command line, then there are tools
such as 'nslookup', 'host', and 'dig' that allow you to make queries of
a name server.

If you are talking about in normal use, most programs call some routine
like gethostbyname() or gethostbyaddr(), which then call the resolver
routines, which query the name server.  In other words, they do it for
you.  No special action is needed on the part of the user, as long as
the system has been properly set up.  Proper setup usually just involves
modifying the /etc/resolv.conf file, and possibly some kind of nsswitch-
type file.

Hope this helps.

-- 
Joe Yao				jsdy at cospo.osis.gov - Joseph S. D. Yao
COSPO/OSIS Computer Support					EMT-B
-----------------------------------------------------------------------
This message is not an official statement of COSPO policies.



More information about the bind-users mailing list