1751966 Members
4519 Online
108783 Solutions
New Discussion

gethostbyname fail

 
Marko_3
Contributor

gethostbyname fail

Dear all

My HP-UX server was running alrite but gave the 'gethostbyname' error all of a sudden when I start APACHE. I tried restarting the server but still encounter the error.

[Mon Feb 12 10:42:08 2001] [alert] mod_unique_id: unable to gethostbyname("myserver")

Nothing is changed. My /etc/hosts was not touched at all..

Can anyone help?

1 REPLY 1
Steven Sim Kok Leong
Honored Contributor

Re: gethostbyname fail

Hi,

What do you see when you execute a nslookup "myserver"? If your nslookup fails, you may wish to check the following configuration files?

1) /etc/nsswitch.conf:
Can you verify that the name resolution uses the /etc/hosts file before any other mechanisms such as DNS? Check your /etc/nsswitch.conf that files is specified before dns or nis, ie.:
hosts: files [NOTFOUND=continue] dns ...

2) /etc/resolv.conf:
If your name resolution uses the dns before files such as /etc/hosts, can you verify that the DNS servers listed in /etc/resolv.conf are correct, are reachable and these DNS servers resolve "myserver" correctly? What about the "domain" entry in /etc/resolv.conf? Was the domain changed?

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com