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

Tom H tomh0665 at gmail.com
Sun Jun 4 10:19:00 UTC 2017


On Sun, Jun 4, 2017 at 5:14 AM, Chris Green <cl at isbd.net> wrote:
> On Sun, Jun 04, 2017 at 04:53:30AM -0400, Tom H wrote:
>> On Sat, Jun 3, 2017 at 10:54 AM, Chris Green <cl at isbd.net> wrote:


>>> Note that the DNS Domain is set too. Still doesn't work.
>>
>> Where is the DNS domain set? In "/etc/systemd/resolved.conf" or in
>> "/etc/systemd/resolved.conf.d/domain.conf"?
>>
> The DNS domain for the *global* section is set in /etc/systemd/resolved.conf.
>
> The DNS domain in the Link 3 section (WiFi) is set by the DHCP server
> when the connection is set up.

OK. Thanks.


>> You should set "LLMNR=no" because, IIRC, a "short" name'll be resolved
>> via llmnr by default.
>>
> I've tried, setting LLMNR=no (or LLMNR=false) doesn't seem to do
> anything, the above status output is with the following in
> /etc/systemd/resolved.conf :-
>
> [Resolve]
> #DNS=
> #FallbackDNS=8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844
> Domains=zbmc.eu fred.com bert.com this.that.tv
> LLMNR=false
> #DNSSEC=no
> #Cache=yes
> #DNSStubListener=udp
>
> Those 'silly' domain names were just to see if I was actually
> modifying the configuration by adding things to the file. As I said
> it looks as if there's something awry with the LLMNR setting.

It looks like LLMNR can't be disabled on a link via the global setting.

If I have the time this afternoon, I'll set up a VM with networkd and
I'll test whether it can be disabled via the link config.

Neither ifupdown nor NM seem to have LLMNR settings and there doesn't
seem to be anything LLMNR-related in "/proc/sys/net/" so this is a
purely networked-provided service.

You'd posted that "systemd-resolve ..." returned the correct address
but that "host ..." didn't. Have you tried "dig ..." or "drill ..."?
(I'd expect them to fail too.)


>> What does "grep hosts /etc/nsswitch.conf" give?
>
> chris$ grep hosts /etc/nsswitch.conf
> hosts: files mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns
>
> I tried removing the 'esolve [!UNAVAIL=return]' but it made no
> difference.

I was hoping that you wouldn't have "resolve" (even though all that it
does, AFAIU, is to send a query to resolved without having to query
127.0.0.53)...

The man page example is

hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname


> Thanks for persevering with me!

You're welcome.




More information about the ubuntu-users mailing list