Hello,
I haven't posted to this list before, but am having a puzzling problem.
I'm having problems with ns_hostbyaddr on a FreeBSD 5.2.1 machine
running AOLserver 4.09 - it doesn't seem to work. I tried the same code
on AOLserver 3.4.2 and it works fine.
I have the following in an adp file:
set peer [ns_conn peeraddr]
ns_puts "peer: $peer"
set host [ns_hostbyaddr $peer]
ns_puts "host: $host"
The first part works fine. The second part doesn't and produces the
following log entries:
[09/Nov/2004:13:08:48][6867.134837248][-conn:server1::3] Error: dns:
getnameinfo failed: Non-recoverable failure in name resolution
[09/Nov/2004:13:08:48][6867.134837248][-conn:server1::3] Error: could
not lookup 192.168.253.140
could not lookup 192.168.253.140
while executing
"ns_hostbyaddr $peer"
invoked from within chunk: 0 of adp:
/usr/local/aolserver409/servers/server1/pages/1.adp
[09/Nov/2004:13:08:48][6867.134837248][-conn:server1::3] Error: could
not lookup 192.168.253.140
could not lookup 192.168.253.140
while executing
"ns_hostbyaddr $peer"
invoked from within chunk: 0 of adp:
/usr/local/aolserver409/servers/server1/pages/1.adp
There is no problem looking up 192.168.253.140 on the machine where
AOLserver is running. I also checked this by doing the following:
set host [ns_hostbyaddr 216.136.204.117]
ns_puts "host: $host"
... which should resolve to www.freebsd.org and this produces the same
error. There is no problem resolving this using dig from a shell.
FreeBSD implements getnameinfo(), so I'm a bit lost.
I have Googled quite a lot and haven't really found a solution. I did
find a bug fix in AOLserver 4.08 which might possibly have some bearing,
possibly it is a platform specific bug:
BUG: DNS resolution now uses getaddrinfo() and getnameinfo() on
platforms where it is available, which are supposed to be
thread-safe. MacOS X has these but as of 10.3.5, may not be
thread-safe according to documentation. On platforms where this new
API is not available, gethostbyaddr_r() and gethostbyname_r() are
used. Otherwise, the old, non-thread-safe gethostbyaddr() and
gethostbyname() are still used. Closes SF Bug #1008721.
Can anyone offer some advice?
Thanks,
John.
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.