Problem : Getting Error: Servname not supported for ai_socktype — getaddrinfo problems? Bind issues?
I have a server running RedHat Enterprise Linux ES 3.3 and I’m having some problems.
Whenever I try to do a whois from the server, or ping anything outside the server itself, I can’t do it.
With whois, if I type in
whois google.com
I get:
[Querying whois.internic.net]
[whois.internic.net: Servname not supported for ai_socktype]
[Unable to connect to remote host]
I might expect bind to be the problem, but it is running and I don’t have a problem connecting to sites via lynx or something like that.
But things like whois, ping and dig all refuse to work
I checked /etc/resolv.conf and it is set to two valid, currently working nameservers.
Just on the off chance, I tried changing it to another pair of nameservers that I know work and the problem doesn’t go away.
Is this a problem with getaddrinfo() or bind itself?
Any ideas?
Solution: Getting Error: Servname not supported for ai_socktype — getaddrinfo problems? Bind issues?
Hi,
Here is my information for your comparison
# uname -r
2.4.21-20.EL
# which whois
/usr/bin/whois
# ldd `which whois`
libc.so.6 => /lib/tls/libc.so.6 (0x00111000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00389000)
===============
jlevie points out one suspeciuos place which:
—-
>read(4, “# /etc/services:\n# $Id: services”…, 4096) = 2348
>read(4, “”, 4096) = 0
>close(4) = 0
>munmap(0xbf4e4000, 4096) = 0
>open(“/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo”, O_RDONLY) = -1 ENOENT (No such file or directory)
=======
should have something like the following
—-
gettimeofday({1100390520, 269801}, NULL) = 0
getpid() = 12791
open(“/etc/resolv.conf”, O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=105, …}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb73eb000
read(4, “search\tconcuity.com ehelathcontr”…, 4096) = 105
read(4, “”, 4096) = 0
close(4) = 0
munmap(0xb73eb000, 4096) = 0
open(“/etc/hosts”, O_RDONLY) = 4
=========
So could you check the /etc/services which has the following lines:
——-
# grep whois /etc/services
nicname 43/tcp whois
nicname 43/udp whois
whois++ 63/tcp
whois++ 63/udp
rwhois 4321/tcp # Remote Who Is
rwhois 4321/udp # Remote Who Is
—-