Ubuntu Not Recognizing Changes To /etc/hosts

A moment ago, I finally figured out why changes to /etc/hosts on my local Ubuntu desktop were not being honored. In the past, it worked just fine, as expected, but this morning, it refused to recognize changes. I searched all over the web and found lots of people with the same problem, but no solutions. Plenty of helpful suggestions, mind you, but nothing would work for the folks who tried them. So, the solution? My NSCD was caching it. Perhaps there was a default value change recently, or maybe I just somehow never noticed it before because I’d add the entry prior to trying to work with the host. Not sure the ultimate reason, but the fix is in:

sudo vim /etc/nscd.conf

Change:
enable-cache hosts yes
…. to:
enable-cache hosts no

And then restart NSCD:

sudo service nscd restart

Voila! Finally, I can get on with my work for the day.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *