Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

ping/ssh <host> resolving to incorrect IP address

SOLVED
Go to solution
miket1
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>
Aliases:
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

 

1 REPLY
miket1
Occasional Visitor
Solution

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