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

Chris Green cl at isbd.net
Sun Jun 4 09:14:15 UTC 2017


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:
> > On Sat, Jun 03, 2017 at 09:48:26AM -0400, Tom H wrote:
> >> On Sat, Jun 3, 2017 at 9:30 AM, Chris Green <cl at isbd.net> wrote:
> >>>
> >>> Before the systemd-resolved came along my systems resolved local (i.e.
> >>> unqualifed) names quite happily, e.g. on my older xubuntu 16.04
> >>> systems I can do:-
> >>>
> >>> There is a local DNS server running on the LAN which provides DHCP and
> >>> DNS to all systems. As can be seen from above the older systems (not
> >>> using systemd-resolver) seem to send the unqualified name requests to
> >>> the DNS system and get the right result. How can I configure
> >>> systemd-resolved to do the same thing?
> >>
> >> # mkdir -p /etc/systemd/resolved.conf.d
> >>
> >> # vi /etc/systemd/resolved.conf.d/local-server.conf
> >> [Resolve]
> >> DNS=ip_address_of_local_dns_server other_dns_server_if_needed
> >
> > It already has these (from DHCP):-
> >
> >         chris at t470$ systemd-resolve --status
> >         Global
> >                   DNSSEC NTA: 10.in-addr.arpa
> >                               16.172.in-addr.arpa
> >                               168.192.in-addr.arpa
> >                               17.172.in-addr.arpa
> >                               18.172.in-addr.arpa
> >                               19.172.in-addr.arpa
> >                               20.172.in-addr.arpa
> >                               21.172.in-addr.arpa
> >                               22.172.in-addr.arpa
> >                               23.172.in-addr.arpa
> >                               24.172.in-addr.arpa
> >                               25.172.in-addr.arpa
> >                               26.172.in-addr.arpa
> >                               27.172.in-addr.arpa
> >                               28.172.in-addr.arpa
> >                               29.172.in-addr.arpa
> >                               30.172.in-addr.arpa
> >                               31.172.in-addr.arpa
> >                               corp
> >                               d.f.ip6.arpa
> >                               home
> >                               internal
> >                               intranet
> >                               lan
> >                               local
> >                               private
> >                               test
> >
> >         Link 3 (wlp4s0)
> >               Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
> >                LLMNR setting: yes
> >         MulticastDNS setting: no
> >               DNSSEC setting: no
> >             DNSSEC supported: no
> >                  DNS Servers: 192.168.1.2
> >                               8.8.8.8
> >                   DNS Domain: zbmc.eu
> >
> >         Link 2 (enp0s31f6)
> >               Current Scopes: none
> >                LLMNR setting: yes
> >         MulticastDNS setting: no
> >               DNSSEC setting: no
> >             DNSSEC supported: no
> >         chris at t470$
> >
> > 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.


> 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.

> 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.

Thanks for persevering with me!

-- 
Chris Green




More information about the ubuntu-users mailing list