My new laptop has xubuntu 17.04 installed and that runs systemd-resolved for local DNS rather than the previous dnsmasq (run by Network Manager).
I have a local server on my network that provides DHCP and DNS for the systems on the LAN and thus I can find things by name. From all my older (xubuntu 16.04) systems this works for both unqualified and FQDNs:-
chris$ host backup backup.zbmc.eu has address 192.168.1.101 chris$ host pi pi.zbmc.eu has address 192.168.1.2 chris$ host backup.zbmc.eu backup.zbmc.eu has address 192.168.1.101 chris$ host pi.zbmc.eu pi.zbmc.eu has address 192.168.1.2 chris$
However, from the xubuntu 17.04 system, it doesn't work for unqualified names:-
chris@t470$ host pi Host pi not found: 2(SERVFAIL) chris@t470$ host backup Host backup not found: 2(SERVFAIL) chris@t470$ host backup.zbmc.eu backup.zbmc.eu has address 192.168.1.101
It looks like it should work because systemd-resolve's configuration seems right:-
chris@t470$ systemd-resolve --status Global DNS Domain: zbmc.eu 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 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
Hey! I think I see the problem, I set LLMNR to 'no' in the configuration but above it's still 'yes'. Why isn't it no? :-
root@t470:/etc/systemd# more /etc/systemd/resolved.conf # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # Entries in this file show the compile time defaults. # You can change settings by editing this file. # Defaults can be restored by simply deleting this file. # # See resolved.conf(5) for details
[Resolve] #DNS= #FallbackDNS=8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844 Domains=zbmc.eu LLMNR=no #DNSSEC=no #Cache=yes #DNSStubListener=udp root@t470:/etc/systemd#
... and I have restarted the service. Help!
On Sat, Jun 03, 2017 at 05:37:07PM +0100, Chris Green wrote: [snip long explanation of problem]
It is actually a bug. It can be worked around by adding the search domain to /etc/resolv.conf though that isn't straighforward as you can't actually edit the file (it's generated by resolvconf). If anyone wants more detail I can post them.
On 7 June 2017 at 19:39, Chris Green cl@isbd.net wrote:
If anyone wants more detail I can post them.
I have similar issues so would appreciate additional info.
On Thu, Jun 08, 2017 at 11:26:27AM +0100, Mark Rogers wrote:
On 7 June 2017 at 19:39, Chris Green cl@isbd.net wrote:
If anyone wants more detail I can post them.
I have similar issues so would appreciate additional info.
OK.
What I have done is to add the search domain for local machines to the file /etc/resolvconf/resolv.conf.d/head. This is the file header that resolvconf uses when it creates /run/resolvconf/resolv.conf at system boot time. /etc/resolv.conf is just a symbolic link to the /run file.
So my /etc/resolvconf/resolv.conf.d/head is:-
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN # 127.0.0.53 is the systemd-resolved stub resolver. # run "systemd-resolve --status" to see details about the actual nameservers.
search zbmc.eu
Is that as much as you need?
By the way that "systemd-resolve --status" is actually quite handy, it's an improvement on the old dnsmasq based system where it was actually very difficult to work out what name servers you were actually using.
On 8 June 2017 at 11:53, Chris Green cl@isbd.net wrote:
Is that as much as you need?
Thanks for that but it would appear that my problem is similar but sufficiently different for that not to help....
I'll hijack your thread since yours is resolved (pun intended!):
I have a DNS server in my office and it will give me an IP for (say) host1.msl-office.co.uk or just host1:
$dig @192.168.1.5 host1.msl-office.co.uk .. host1.msl-office.co.uk. 0 IN A 192.168.1.140
$dig @192.168.1.5 host1 .. host1. 0 IN A 192.168.1.140
However, if I don't specify the DNS server then only the FQDN form works: $dig host1.msl-office.co.uk .. host1.msl-office.co.uk. 0 IN A 192.168.1.140
$dig host1 .. host1. 0 IN A
Consequently, I cannot (for example) use ssh mark@host1, but have to use ssh mark@host1.msl-office.co.uk (or use the IP).
Following your method I assumed (hoped?) that the msl-office.co.uk suffix would get added automatically and fix this, but it doesn't; in any case the issue is really that systemd-resolve should be sending the request for host1 to the configured DNS (which will give the correct response if it does), but it doesn't do that. (Getting it to add the domain on the end first would be a workaround rather than a proper fix, but I'd settle for that.)
As an aside: My DNS server will also resolve *.host1 to the correct IP, and that is working via the default configuration as well: $dig anything.host1 .. anything.host1. 0 IN A 192.168.1.140
It is *only* the hostname on its own that is failing me.