[Peeweelinux] resolve a domain name

Troy Engel [email protected]
Mon, 15 Sep 2003 15:09:16 -0700


Barry Gershenfeld wrote:
> 
>>search foo.com
> 
> 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?

This is for when you want to use short notation for a machine -- ie, 
with "search fluid.com" I can then say "ping www" and it knows to search 
the fluid.com domain for the rest, resulting in www.fluid.com.

> 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:

Well, I can't sepak for nslookup but it sounds about right -- when in 
doubt, use "ldd <foo>" to query a binary to see all it's dynamically 
linked libs (and handy if you have multiple versions of a lib, it'll 
tell you exactly which one the program is using).

On my PeeWee instance, nslookup is just a symlink over to busybox. On a 
real RH62 system (which PeeWee is based on):

# ldd `which nslookup`
   libdns.so.5 => /usr/lib/libdns.so.5 (0x4001c000)
   libcrypto.so.0 => /usr/lib/libcrypto.so.0 (0x40105000)
   libisc.so.4 => /usr/lib/libisc.so.4 (0x401be000)
   libnsl.so.1 => /lib/libnsl.so.1 (0x401f0000)
   libpthread.so.0 => /lib/libpthread.so.0 (0x40207000)
   libc.so.6 => /lib/libc.so.6 (0x4021a000)
   /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

So, obviously your mileage may vary. ;) I don't use nslookup in the PWL 
systems, the apps themselves know how to use the C api and call 
gethostbyname(), etc normally. Even the java stuff.

> 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.

On my PWL boxes, it works just fine -- they are stationed throught the 
USA, and talk to a home server based on it's name, not IP. Never had a 
problem. They all have the same nameservers in /etc/resolv.conf - some 
use PPP, some DHCP, etc.

Methinks something's not quite right on your PWL instance...?

-te

-- 
Troy Engel, Systems Engineer
...his bash-fu is great.