[Peeweelinux] resolve a domain name

Barry Gershenfeld [email protected]
Thu, 11 Sep 2003 18:12:53 -0700 (PDT)


>Additionally, in case the obvious has been overlooked, you need a file 
>/etc/resolv.conf with the desired nameservers, eg:

>search foo.com
>search bar.com
>nameserver 192.168.0.1
>nameserver 192.168.0.37

What is the purpose of the "search" lines, especially if
it needs to resolve foo.com or bar.com to even be able
to use them?  Or are they assumed to be in hosts?

>When apps using libnss_dns fire up, the libs use this file as it's 
>config of which nameservers to talk to...

I read that libresolv does the name lookups.  I don't have
libnss_dns installed.   I installed nslookup.  When I
run it, it does not complain about any libraries missing.
The result of nslookup is:

Server:     default
Address:    default

*** Unknown host

Finally I want so clarify my intent which is to be able to
use a domain name, for instance, if I want to fetch a package
off a site somewhere.  So it's not a manual operation, 
rather some other program would be thinking it could use
a URL.  Although, if it's possible to run the output of 
nslookup through a shell script to get this done instead of 
having to install some other program, that would be 
interesting.

It's not all that obvious. I'm trying to piece it together
so I understand which parts do which.  For example I could
not ping anything until I added a default route.  I can
download stuff if I use the IP address instead of a name.

Information like "libnss-dns is what looks in /etc/resolv.conf"
is very valuable.  We often think a particular program is
responsible.

Barry