0
I have defined some hostnames in /etc/hosts i.e. 192.168.15.20 example.com
when I do ping example.com
I get the reolved ip as the one defined in /etc/hosts but when I change this IP to another IP (keeping the same host name) it still reads the old IP. also sometimes when I do ping it uses the new IP but when doing telnet I see the old IP in the log of the command.
I'm using Red Hat Enterprise Linux Server release 6.5 (Santiago)
I made a few changes to hosts on mine and they are instant. But it might be worth trying to restart the network adapters on the server with
/etc/init.d/networking restart
orifdown eth0 && ifup eth0
– Panomosh – 2018-03-21T13:05:45.297Have you checked your nsswitch.conf file? I'm not too familiar with the details, but I know that it CAN be setup to skip the hosts file, if desired. – Michael Kohne – 2019-10-30T14:57:11.677