You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
resolve: domain names ending with .local not resolved #4881
According to the comment in resolved-dns-scope.c:466, having the following entry in /etc/resolv.conf:
search somenet.local
should cause resolved to handle the domain somenet.local like any other domain (instead of treating it as mDNS). Yet it fails to do so:
$ systemd-resolve somehost.somenet.local
somehost.somenet.local: resolve call failed: No appropriate name servers or networks for name found
$ echo $?
1
whereas using drill or dig to query the DNS server to resolve a .local domain name works fine.
Steps to reproduce the problem
Use /etc/nsswitch.conf as recommended in the nss-resolve (8) man page.
Create a symbolic link /etc/resolv.conf to /run/systemd/resolve/resolv.conf.
Make sure resolved is running and resolv.conf contains the nameserver and the .local network domain in the search list as advertised by the DHCP server (will require either UseDomains=yes in /etc/systemd/network/×××.network, or Domains=... in /etc/systemd/resolved.conf).
Use drill or dig to successfully query the DNS server for a .local host in the network.
Use systemd-resolve to attempt to resolve the same name (or any userspace application to attempt to connect to that host).
Changing the line in /etc/nsswitch.conf as follows resolves the problem temporarily, as glibc will continue to query the DNS server if resolved fails:
hosts: files mymachines resolve dns myhostname
But that is just a workaround (as would be disabling the stub DNS resolver of resolved).
Reacted by Lluis, Piotr Dobrogost, sizaxyd and Iizuki
changed the title [-]Names in .local TLD not resolved [OR] Mismatch between nss-resolve manpage and actual status[/-][+]resolve: Names in .local TLD not resolved [OR] Mismatch between nss-resolve manpage and actual status[/+]on Dec 13, 2016
@ayekat using this form: hosts: files mymachines resolve dns myhostname
Wouldn't failed resolutions happen twice? E.g. resolve cannot resolve a hostname, then it continues to dns which probably does the same thing as resolve just tried.
I think the intention is for resolve to be a replacement for both dns and myhostname and only use the latter two if resolved is not installed/running.
In theory, yes. But in this case (domains ending with .local), resolve fails to resolve the hostname, whereas dns succeeds.
However, reading your comment, I do see the intention behind [!UNAVAIL=return] now. Thank you, it does make more sense to me now. I therefore assume that the bug lies with resolved having trouble with the .local TLD. But I'd like to hear some feedback on that before jumping to false conclusions.
I naively expect above behavior (failing name resolution) to return the UNAVAIL status
I think you should not expect this as according to man nsswitch.confunavail means
The service is permanently unavailable. This can
mean either that the required file cannot be read,
or, for network services, that the server is not
available or does not allow queries. The default
action for this condition is "continue".
thus in case of a name service failing to resolve a name it should not return unavail as it was trying to perform name resolution.
I have /etc/resolve.conf symlinked to /usr/lib/systemd/resolv.conf which contains only one entry nameserver 127.0.0.53 and systemd-resolved/nslookup both resolve local hosts in .local domain fine (however they stop resolving these hosts after some time which I raised as issue #5048. Is there anything preventing you from using this setup instead of symlinking /etc/resolv.conf to /run/systemd/resolv.conf?
I think the intention is for resolve to be a replacement for both dns and myhostname and only use the latter two if resolved is not installed/running.
This would be a logical consequence of systemd-resolved being more capable than traditional name resolution through resolv.conf. If this is the case then the resolution of this bug should be to state the rationale for using UNAVAIL and not NOTFOUND clearly in the docs.
changed the title [-]resolve: Names in .local TLD not resolved [OR] Mismatch between nss-resolve manpage and actual status[/-][+]resolve: domain names ending with `.local` not resolved[/+]on Jan 9, 2017
OK, now I'm a little puzzled. systemd-resolve is now able to correctly resolve names ending with .local again. Still same version as stated above. I am not sure how this (or above) has happened, but this all seems to be a non-issue.
I'm sorry for all the noise. I'll investigate on how above might have happened; for the moment, I will close this issue.
I am not sure how this (or above) has happened, but this all seems to be a non-issue.
I suspect you might be observing the same problem which I raised in issue #5048. The next time .local names stop resolving (and I suspect they will stop) see if running systemd-resolve --flush-cashes resolves :) the issue (it does in my case). It seems using NOTFOUND status in place of UNAVAIL in nsswitch.conf is the perfect workaround for now :)
It's a pity no maintainer answered here for a month since this issue was raised...
In issue #5051 there's exactly opposite problem raised; dig doesn't resolve .local names whereas systemd-resolve does resolve these names. Although in that case the name being resolved is single-label as opposed to multi-label like here.
It would be useful to see output of systemd-resolve --status to get some insight as to why systemd-resolve does not resolve some name.
I have other non .local domain zones configured on the same dns server and they resolve fine. Unless they are CNAME or DNAME records that point to something .local, then everything breaks again.
Activity
[-]Names in .local TLD not resolved [OR] Mismatch between nss-resolve manpage and actual status[/-][+]resolve: Names in .local TLD not resolved [OR] Mismatch between nss-resolve manpage and actual status[/+]bits01 commentedon Jan 8, 2017
@ayekat using this form:
hosts: files mymachines resolve dns myhostnameWouldn't failed resolutions happen twice? E.g.
resolvecannot resolve a hostname, then it continues todnswhich probably does the same thing asresolvejust tried.I think the intention is for
resolveto be a replacement for bothdnsandmyhostnameand only use the latter two ifresolvedis not installed/running.ayekat commentedon Jan 8, 2017
In theory, yes. But in this case (domains ending with
.local),resolvefails to resolve the hostname, whereasdnssucceeds.However, reading your comment, I do see the intention behind
[!UNAVAIL=return]now. Thank you, it does make more sense to me now. I therefore assume that the bug lies with resolved having trouble with the.localTLD. But I'd like to hear some feedback on that before jumping to false conclusions.piotr-dobrogost commentedon Jan 9, 2017
I think you should not expect this as according to man nsswitch.conf
unavailmeansthus in case of a name service failing to resolve a name it should not return
unavailas it was trying to perform name resolution.I have /etc/resolve.conf symlinked to /usr/lib/systemd/resolv.conf which contains only one entry
nameserver 127.0.0.53and systemd-resolved/nslookup both resolve local hosts in .local domain fine (however they stop resolving these hosts after some time which I raised as issue #5048. Is there anything preventing you from using this setup instead of symlinking /etc/resolv.conf to /run/systemd/resolv.conf?This would be a logical consequence of systemd-resolved being more capable than traditional name resolution through
resolv.conf. If this is the case then the resolution of this bug should be to state the rationale for usingUNAVAILand notNOTFOUNDclearly in the docs.[-]resolve: Names in .local TLD not resolved [OR] Mismatch between nss-resolve manpage and actual status[/-][+]resolve: domain names ending with `.local` not resolved[/+]ayekat commentedon Jan 9, 2017
OK, now I'm a little puzzled.
systemd-resolveis now able to correctly resolve names ending with.localagain. Still same version as stated above. I am not sure how this (or above) has happened, but this all seems to be a non-issue.I'm sorry for all the noise. I'll investigate on how above might have happened; for the moment, I will close this issue.
Thanks to everyone who responded anyway.
piotr-dobrogost commentedon Jan 9, 2017
I suspect you might be observing the same problem which I raised in issue #5048. The next time .local names stop resolving (and I suspect they will stop) see if running
systemd-resolve --flush-cashesresolves :) the issue (it does in my case). It seems usingNOTFOUNDstatus in place ofUNAVAILin nsswitch.conf is the perfect workaround for now :)It's a pity no maintainer answered here for a month since this issue was raised...
piotr-dobrogost commentedon Jan 10, 2017
In issue #5051 there's exactly opposite problem raised; dig doesn't resolve .local names whereas systemd-resolve does resolve these names. Although in that case the name being resolved is single-label as opposed to multi-label like here.
It would be useful to see output of
systemd-resolve --statusto get some insight as to why systemd-resolve does not resolve some name.JoelLinn commentedon Dec 20, 2025
9 years and this issue still persists
resolvectl flush-caches && resolvectl query privat.linn.localwhereas nslookup works fine.
I have other non .local domain zones configured on the same dns server and they resolve fine. Unless they are CNAME or DNAME records that point to something .local, then everything breaks again.