I'm running OL5U8 on kernel 2.6.32-300.32.2.el5uek. The resolv.conf file points to two Windows 2008 DNS servers. Is there a way to flush the dns cache on OL5U8, something like ipconfig /flushdns in Windows?
What happen was I added a second nic card on a OL5U8 virtual machine and gave it a static ip address ending in .82. Only to find out there was a reverse pointer in the Windows DNS server with that address. So I changed it to .44 but every time I ping the hostname, its resolving to .82 instead of .44.
I've already added A record and reverse pointer for the hostname to the .44 address. The .82 reverse pointer is still there until I can find out from the team here why its there.
But is there a way to flush the dns cache from my other OL5U8 servers so they stop returning .82 when I ping the server? Dnsmasq and nscd are not being used with both services turned off.
I'll rather not restart the network service if I can avoid it.
Caching is performed by your DNS server and web browser. Every DNS record has a TTL value defining it's time to live before it expires. As far as I understand, the Linux DNS resolver does not cache DNS records based on their TTL Value. You can enable DNS caching using the nscd daemon or dnsmasq. By default, both services are not enabled:
chkconfig --list nscd
nscd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
chkconfig --list dnsmasq
dnsmasq 0:off 1:off 2:off 3:off 4:off 5:off 6:off
If any of them are enabled, try "service restart nscd" or "service restart dnsmasq" to reset the cache.
Thanks Dude. Both nscd and dnsmasq are turned off, stock ol5u8 builds. I guess you are right that the caching was done by the windows DNS server which I suspect may have a TTL of an hour, hence it came good after about that time frame. Thanks again.