dns lookup on debian

resume.robot
Posts: 68
Joined: Sat Jan 13, 2001 1:23 am

dns lookup on debian

Post by resume.robot »

Webinator WWW Site Indexer Version 2.52 (Commercial)
Copyright(c) 1995,1996,1997,1998 Thunderstone EPI Inc.
Release: 19990218

Debian linux kernel 2.2.19

Error message produced by gw:

000 Can't get address for host `(whatever hostname)': Unknown error


nslookup works fine

uname -n agrees with /etc/hosts file


Where do I look next?

Thanks
User avatar
Kai
Site Admin
Posts: 1271
Joined: Tue Apr 25, 2000 1:27 pm

dns lookup on debian

Post by Kai »

Name resolution is done via gethostbyname() in that version of gw, which uses /etc/host.conf or something similar to tell it how to look up names. Check that that file is set up correctly for your environment (see man gethostbyname()). nslookup usually queries the nameserver directly, so it may not be affected by /etc/host.conf
resume.robot
Posts: 68
Joined: Sat Jan 13, 2001 1:23 am

dns lookup on debian

Post by resume.robot »

/etc/host.conf seems to be correct:

order hosts,bind
multi on


I have tried different orders using hosts, bind & nis


When I run the following perl test script, called "gethostbyname", it produces accurate results:

#!/usr/local/bin/perl
foreach (@ARGV) {
$ipi = (gethostbyname($_))[4];
if ($ipi) {
print(join(".",unpack("C4", $ipi)),"\n");
} else {
warn "$_: unknown host\n";
}
}


# ./gethostbyname ls.thunderstone.com
208.51.0.47
# ./gethostbyname bogushost.com
bogushost.com: unknown host


Is there possibly an issue with uid, path or permissions? Webinator was installed as root.
User avatar
Kai
Site Admin
Posts: 1271
Joined: Tue Apr 25, 2000 1:27 pm

dns lookup on debian

Post by Kai »

Shouldn't be an issue for name lookup, but Webinator should not be run as root in general because it encourages permissions problems elsewhere (other-uid texis processes can't write/access database files, eg. in CGI mode). Pick a single non-root user to setuid it (and texis) to, and chown all Webinator/texis files to that user.

Might be a C lib linking issue: that's a fairly old version of gw, probably linked against an old libc. It may be expecting a different version of the shared lib, as it was linked on an old Red Hat version; wouldn't be the first time that's happened across Linux releases.
resume.robot
Posts: 68
Joined: Sat Jan 13, 2001 1:23 am

dns lookup on debian

Post by resume.robot »

Do you have any idea how to track down this error?
User avatar
mark
Site Admin
Posts: 5514
Joined: Tue Apr 25, 2000 6:56 pm

dns lookup on debian

Post by mark »

DNS in general may be working, but what about for the host "whatever hostname" you are getting the error on? No need to resort to perl or any other script for dns testing. Your system should have a program called "host" and/or "nslookup" which you can use directly:
host whateverhostname

Run
ldd gw
to see what libraries are being used. See ftp://ftp.thunderstone.com/pub/linux for any libs you may beed.
Run
strace gw ...
to see what it does.
resume.robot
Posts: 68
Joined: Sat Jan 13, 2001 1:23 am

dns lookup on debian

Post by resume.robot »

Thanks for your followup on this problem.

host and nslookup work:

# host thunderstone.com
thunderstone.com A 208.51.0.81

# nslookup thunderstone.com
Server: dns1.hawaii.rr.com
Address: 24.25.227.64

Non-authoritative answer:
Name: thunderstone.com
Address: 208.51.0.81

here are ldd results:

# ldd /gw
statically linked (ELF)

ldd /...path.../texis produces the same result

I do not know what this means.

# ldd -v
ldd: version 1.9.11

s# ldd -V
/lib/ld.so: version 1.9.11


strace /gw produces a very long response, including the lines

open("/usr2/pub/httpd/htdocs/webinator/db//SYSLOCKS.SEQ", O_RDWR|O_CREAT, 0666)
chmod("/usr2/pub/httpd/htdocs/webinator/db//SYSLOCKS.SEQ", 0666) = 0

This path did not exist. I created the path

/usr2/pub/httpd/htdocs/

and then used ln -s to create a symbolic link to the webinator directory.

What would you be looking for from the strace results?

Debian Linux version is 2.2.19

According to the readme.txt file at

ftp://ftp.thunderstone.com/pub/linux

the method should be to download libs. The closest I can find is 2.2.5, does this sound correct?

I do not see any duplication of files, it looks like the final version numbers (so.2, etc) are all higher than the ones on my system.

Also, the tar.gz file does not contain all of the files in the directory, should they all be installed? In most cases, it looks like the tar.gz file contains the most recent versions, while the directory contains some earlier versions, except for ld.linux.so.2, so my thought is to install the files from the tar.gz and see what happens.

Then, untar the files in the /usr/lib directory, and run ldconfig.

Correct so far?

man ldconfig shows a number of options, and also explains that it is run at startup, so a reboot should do the trick, correct?

Thanks again.
User avatar
mark
Site Admin
Posts: 5514
Joined: Tue Apr 25, 2000 6:56 pm

dns lookup on debian

Post by mark »

The idea with strace was to trace gw with the options you're using. Anyhow, ldd is saying that your version is statically linked so adding shared libs won't matter. Something about the system changed so the static program can't get the info it needs. Maybe some config file(s) moved around. Use strace to see what DNS related file(s) it's looking for and not finding.
strace -e trace=open,access,stat gw YOUROPTIONS
Look for errors such as "ENOENT" and the like to see if it's looking for a system config file that may be in a different location now. If you find one that has moved, you'll need to make a soft link to the new location from the old one the program is looking for.

The other option is to purchase an update that will run as is on newer linux's.
resume.robot
Posts: 68
Joined: Sat Jan 13, 2001 1:23 am

dns lookup on debian

Post by resume.robot »

Thank you for your followup.

Debian versions are known for changing paths.

Here is some of the output from strace

open("/share/locale/C/LC_MESSAGES", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/share/locale/C/LC_TIME", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/share/locale/C/LC_NUMERIC", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/share/locale/C/LC_MONETARY", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/share/locale/C/LC_CTYPE", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/share/locale/C/LC_COLLATE", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/usr/lib/zoneinfo/localtime", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/zoneinfo/GMT", O_RDONLY) = -1 ENOENT (No such file or directory)


open("/share/locale/C/LC_MESSAGES", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/etc/locale/C/libc.cat", 0xbffff83c) = -1 ENOENT (No such file or directory)
stat("/usr/lib/locale/C/libc.cat", 0xbffff83c) = -1 ENOENT (No such file or directory)
stat("/usr/lib/locale/libc/C", 0xbffff83c) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale/C/libc.cat", 0xbffff83c) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/locale/C/libc.cat", 0xbffff83c) = -1 ENOENT (No such file or directory)


The system does not have a /share directory

There is a /usr/share/locale directory, but there is no C subdirectory

There is a /usr/bin/locale executeable file
User avatar
mark
Site Admin
Posts: 5514
Joined: Tue Apr 25, 2000 6:56 pm

dns lookup on debian

Post by mark »

Those are all related to messages and timezones, and should not affect anything dns related. If there aren't any similar messages about other config files the kernel level system calls must be different. In that case there's nothing to do but upgrade.
Post Reply