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

Tom H tomh0665 at gmail.com
Sun Jun 4 14:19:23 UTC 2017


On Sun, Jun 4, 2017 at 9:59 AM, Xen <list at xenhideout.nl> wrote:
> Tom H schreef op 04-06-2017 15:40:


>> So getent works with the libnss_resolve module but not with the
>> libnss_dns module.
>
> No, the libnss_dns module just doesn't work without "search".

I'd had to re-read the "resolv.conf" man page to be sure but, IIRC, if
"/etc/resolv.conf" doesn't have a search or domain entry, the local
system's domain is searched for short hostnames by default.


>> So "host" fails with both "resolve" and "dns" (previously it was
>> failing with "resolve" and returning).
>
> It doesn't use nsswitch.

Thanks. True. It was a stupid test and comment :(


>> The problem seems to be that host and dig can only resolve short
>> ("zero-dotted? LOL) hostnames if there's a domain or search entry in
>> "/etc/resolv.conf"; and it might or might not be related to the fact
>> that LLMNR cannot be turned off
>
> Yes.
>
> But systemd-resolved apparently requires the search directive when accessed
> through 127.0.0.53 as it expects these queries to conform to the
> /etc/resolv.conf specification.
>
> The problem is that host doesn't go through that,
> but a command like "ping" probably would.
>
> I mean the reverse: host goes directly to /etc/resolv.conf,
> while "ping" probably uses /etc/nsswitch.conf.
>
> So most ordinary programs would work, just not programs that have their own
> individual DNS resolving.
>
> Thus, programs that talk DNS directly fail to work.

ACK. In other words, querying resolved for a short hostname fails
without the appropriate domain or search entry in "/etc/resolv.conf"
in spite of resolved being configured with a "Domain=" directive. I
wonder whether resolved can provide dig and co domain information
without populating "/etc/resolv.conf with that information.




More information about the ubuntu-users mailing list