[CentOS] Reloading /etc/hosts
centos at linuxpowered.net
Mon Aug 4 13:51:55 UTC 2008
Robert Moskowitz wrote:
> I am doing some testing and am having to make many changes to /etc/hosts
> Is there a way to reload the /etc/hosts file without doing a service
> network restart?
There is no need to reload the hosts file, it's read in real time.
Some things like firefox maintain their own host cache though, and
you'll either have to restart it or wait for it's timeout before
the changes take effect.
If your running nscd, you may have to either restart nscd or
run "nscd -i hosts" to invalidate the hosts cache there. nscd
is typically only run on a system that is participating in network
authentication like LDAP.
More information about the CentOS