NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Why doesn't NetBSD recognize my entries in /etc/hosts?

On 16 September 2015 at 23:19, Eric Haszlakiewicz <> wrote:
> On September 16, 2015 3:30:43 PM EDT, Ottavio Caruso <> wrote:
>>On 16 September 2015 at 19:06, Johnny Billquist <>
>>> On 2015-09-16 19:09, Ottavio Caruso wrote:
>>>> RE:
>>>> I put domains that I want to block in /etc/hosts preceded by
>>>> but I can still ping them.
>>>> I rebooted, but I can still ping them.
>>>> Then I have mass-changed all entries from to and I
>>>> can still ping them.
>>>> Rebooted, same thing.
>>>> Why can I do this effortlessly with Windows and Linux but not with
>>> First of all, using /etc/hosts as a way of block domains is extremely
>>> unreliable and not really a meaningful way of actually block
>>Why? It works on other platforms?
>>> Second, I guess you haven't heard of /etc/nsswitch.conf. It also
>>exists in
>>> Linux. It tells which methods are used, and in which order. It might
>>be that
>>> you have dns before files.
>>I've checked my nsswitch.conf, it's files before hosts
>>> Changing a destination to, and then pinging it, why would
>>> expect it to not work. will most likely respond to pings.
>>> Pinging will also give some result. Most probably your
>>> gateway machine.
>>Yes, I didn't express myself correctly. I meant that I ping the
>>original host, not
>>BTW, rebooting TWICE produced the intended result. I wonder why I had
>>to reboot twice.
> Fwiw, using /etc/hosts sounds entirely reasonable for what you're trying to do (and hosts.deny, though having a similar name, is pointless to look at).
> Do additional changes require a reboot?  If so, something is really odd.  Changes to /etc/hosts should take effect immediately.  Maybe use ktrace/kdump to see if it's actually being read?

It is odd. Same thing happened last year. It takes two reboots to
apply changes, and this only if I redirect to but not to, in which case it hangs. The works in both Windows and
Linux, it doesn't appear to work at all for me.


Home | Main Index | Thread Index | Old Index