Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

ping/ssh <host> resolving to incorrect IP address

Go to solution
Occasional Visitor

ping/ssh <host> resolving to incorrect IP address

When I ping/ssh to one particular host using the hostname the request is going to an incorrect IP address, it works fine if I use the explicit IP address. The incorrect IP address happens to be in the same subnet as the correct IP address x.x.x.228 rather than x.x.x.80
If I do an nsquery for this host it returns the correct IP address from /etc/hosts, the incorrect IP address is not present in /etc/hosts or on the DNS servers.
There are over 1,000 entries in /etc/hosts and this is the only one that appears to be incorrectly resolved

Any ideas why this is happening?

HP-UX 11.31

# nsquery hosts <hostname>

Using "files [NOTFOUND=continue UNAVAIL=continue] dns " for the hosts policy.

Searching /etc/hosts for <hostname>
Hostname: <hostname>
Address: <correct_ip_address>
Switch configuration: Terminates Search

# ping <hostname>
PING <incorrect_ip_address> byte packets
----<incorrect_ip_address> PING Statistics----
2 packets transmitted, 0 packets received, 100% packet loss

# cat /etc/nsswitch.conf
hosts: files [NOTFOUND=continue UNAVAIL=continue] dns


Occasional Visitor

Re: ping/ssh <host> resolving to incorrect IP address

I've added this to /etc/nsswitch.conf and it now seems to be working:

ipnodes: files [NOTFOUND=continue] dns