http://qs321.pair.com?node_id=1128426


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