/etc/hosts handling plugin for unbound

Paul Wouters paul at nohats.ca
Thu Dec 29 23:54:26 UTC 2022

On Thu, 22 Dec 2022, Petr Menšík via Unbound-users wrote:

> Domain suffix should not be necessary. /etc/hosts allows
> aliases, so you can have line like "  primary.example.com primary". That would make primary.example.com a primary
> fully qualified domain name. And "primary." just an alias without matching PTR record.

Would it be a TLD "primary.", or would it be primary.<yourdomainsuffix>.  ?

It's tricky loading /etc/hosts into a resolver for unqualified entries.
I kinda hope that unbound would just ignore them. A quick test shows
it will just override a real FQDN. So on my machine with "search nohats.ca"
in /etc/resolv.conf, an entry in /etc/hosts for "www" will use whatever
is in /etc/hosts and not what is in dns for www.nohats.ca.

> It seems to me it could be a special implementation of Cache DB module. I admit I have never tried to use CacheDB module
> yet.

Not sure if this is worth the energy, when a simple systemctl restart unbound
would also reread /etc/hosts. Sure you lose your cache, but I lost that
battle a long time before when every interface change results in cache


More information about the Unbound-users mailing list