How to get the systemd resolver to resolve local (i.e. unqalified) names?

Tom H tomh0665 at gmail.com
Sun Jun 4 10:29:27 UTC 2017


On Sun, Jun 4, 2017 at 5:24 AM, Xen <list at xenhideout.nl> wrote:
>
> I realize that but for me it is useful to know how to have some degree of
> choice in what system will be used.
>
> If systemd still uses /etc/resolv.conf, that is peculiar.
>
> Then it uses unmodified libnss-dns.so and just becomes the forwarding dns
> server.
>
> Previously in an email it was said that systemd-resolved would use nsswitch
> directly, and not use /etc/resolv.conf at all.
>
> Therefore I assume that it *doesn't* use /etc/resolv.conf at all but just
> messes with it, as was indicated.
>
> Therefore you can assume that the /etc/resolv.conf is not actually used by
> systemd-resolved and it actually did change the nsswitch.conf system, but I
> don't know how.
>
> There is no way normally to change the behaviour of getbyhostname unless you
> modify either nsswitch itself or those libraries.
>
> You can do:
>
> getent hosts
>
> to get the list of hosts found via nsswitch.conf, and "getent host <name>"
> to resolve it.
>
> This will show you what the nsswitch.conf system actually returns.

resolved can be queried two ways:

- via "127.0.0.53" in "/etc/resolv.conf" and "dns" on the "hosts" line
of "/etc/nsswitch.conf"

- via  "resolve" on the "hosts" line of "/etc/nsswitch.conf"

I'd forgotten about getent. You could try "getent ahostsv4 esprimo" to
check whether it works but tis still won't solve the fact that "host
esprimo" is failing.




More information about the ubuntu-users mailing list