Using telnet and it was pointing to a wrong address. Ping was directing to correct IP address

linux was solving hostname to an incorrect IP address when using telnet

root@linux:~ # telnet host24100
Trying 172.22.12.135…
telnet: connect to address 172.22.12.135: Connection refused

It was solving to the correct IP address when using ping

root@linux:~ # ping -c1 host24100
PING host099.setaoffice.com (172.22.84.143) 56(84) bytes of data.
64 bytes from host27100.setaoffice.com (172.22.84.143): icmp_seq=1 ttl=127 time=1.32 ms

— host099.setaoffice.com ping statistics —
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.321/1.321/1.321/0.000 ms

I’ve restarted nscd service

root@linux:~ # service nscd status
Checking for Name Service Cache Daemon: running

root@linux:~ # service nscd stop
Shutting down Name Service Cache Daemon done

root@linux:~ # service nscd start
Starting Name Service Cache Daemon done

After the restart, it started to point to the correct IP address

root@linux:~ # telnet host24100 24100
Trying 172.22.84.143…
Connected to host24100.
Escape character is ‘^]’.
0G^]
telnet> quit
Connection closed.

Advertisement