Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: /etc/hosts is not evaluated after modification on Linux

by philipbailey (Curate)
on May 30, 2015 at 21:11 UTC ( [id://1128426] : note . print w/replies, xml ) Need Help??


in reply to /etc/hosts is not evaluated after modification on Linux

As Corion says, it sounds like a caching issue. On SLES, it is likely you have an nscd daemon running, which is responsible for caching this data. According to the documentation, running this command after changing /etc/hosts will invalidate the cache and should resolve your problem, I think:

sudo nscd -i /etc/hosts

Replies are listed 'Best First'.
Re^2: /etc/hosts is not evaluated after modification on Linux
by Anonymous Monk on May 31, 2015 at 06:22 UTC
    Indeed, following helps: system("/usr/sbin/nscd", "-i", "hosts"); Thanks a lot! -Vadim