[RC5] name resolution

Greg Wooledge greg at wooledge.org
Mon Sep 24 10:39:07 EDT 2001


Christopher Hicks (chicks at chicks.net) wrote:
> On Sun, 23 Sep 2001 lost at l-w.net wrote:
> > Is there any particular reason that dnetc needs "nslookup" to resolve
> > domain names when running under Linux?
> There's some stuff in there to parse the output of it as well.  What's
> wrong with gethostname???

My best guess would be the libc5/libc6 issue.  The Linux dnetc is
statically linked, so it will run on any system, but the nature of
the host lookup calls on Linux changed when lib6 was adopted -- and
it broke the client on libc5 systems.

The client is (probably still) developed on libc6 boxes, since that's the
de facto standard these days.  A name lookup call on a libc6 box requires
an /etc/nsswitch.conf file, which a libc5 box doesn't have.  Even if
you statically link, the library call *still* needs /etc/nsswitch.conf
and it's simply not present on older systems.

But there's gotta be a better way than calling the nslookup command.
Has anyone considered the possibility of a chroot() within the client,
setting up a directory with its own $CHROOT/etc/resolv.conf (copied
from the system's at dnetc startup time, before the chroot()) and
$CHROOT/etc/nsswitch.conf?

Failing that, it may be best to statically link the Linux client on a
libc5 system.

-- 
Greg Wooledge                  |   "Truth belongs to everybody."
greg at wooledge.org              |    - The Red Hot Chili Peppers
http://wooledge.org/~greg/     |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
Url : http://lists.distributed.net/pipermail/rc5/attachments/20010924/8c27e4a7/attachment-0001.bin


More information about the rc5 mailing list