.local names are resolved not through DNS and normally long before
DNS, hence long before /etc/resolv.conf is ever consulted. That is...
"Normal" name resolving (i.e., through the regular system libraries) is configured through /etc/nssswitch.conf. If you look you will see something like
Code: Select all
hosts: files mdns4_minimal [NOTFOUND=return] wins dns myhostname
and any of those entries refer to a fully different type of resolver. .local is mDNS and is as you can see resolved early on, directly after and if "files" (i.e., /etc/hosts) failed to resolve a certain name (the [NOTFOUND=return] interjection has resolving of .local names not resolved by mDNS fail at that point; not try further i.e., has mDNS authoratitive for .local, so to speak).
In any case, what's important here is that "dns" is later
: when you try to resolve "turtle" it fails to be resolved by /etc/hosts, then via mDNS, then (in this case) WINS and only then gets to DNS. Also fails that, retries as "turtle.local" -- but also fails, first probably because it knows to not even try .local names but certainly also because we're long past mDNS which is the only thing that resolves turtle.local.
Or, well, that's to say...
systemd-resolved can actually be configured to do mDNS itself at which point .local as a search domain might be functional. I don't use systemd-resolved (have replaced it with dnsmasq) and can as such not in fact test things but for this you certainly need
in /etc/systemd/resolved.conf and I believe
sudo systemd-resolve --set-mdns=yes --interface=<interface>
for the correct interface (enp<X>s<Y> or some such).
I could not tell you if you should in this situation also keep Avahi up or whether or not this would create conflicts; can as said not easily test things locally. The best answer in any case is that you should just spell out the .local suffix if using mDNS...