After installing and starting tailscape the host lookup tools don’t use /etc/hosts anymore, i.e. host, dig, nslookup don’t work for entries in /etc/hosts.
However I can still ping those hosts so it’s not all lost.
Anybody can shed some light on this? How to solve it, will it possibly be solved in future by tailscape or …?
I don’t think those tools have ever used /etc/hosts, as far as I know. They’ve always generated their own DNS request packets so they can parse the responses, and DNS requests packets have to go to a real DNS server.
According to dig, looks like you have a DNS server running on 127.0.0.1 that is responding wtih /etc/hosts entries? That’s… not what I expected. Maybe this is a macOS or systemd-resolved thing?
Just to clarify, I am already using MagicDNS, it works pretty well but my NAS does not run tailscale (ReadyNAS https://github.com/tailscale/tailscale/issues/882) so I keep using /etc/hosts for that.
Think it would be pretty useful if /etc/hosts entries were used by MagicDNS.
I have default ubuntu nsswitch.conf:
erik@jojda:~$ cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat systemd sss
group: compat systemd sss
shadow: compat sss
hosts: files myhostname mdns4_minimal [NOTFOUND=return] dns mdns4 mymachines
networks: files
protocols: db files
services: db files sss
ethers: db files
rpc: db files
netgroup: nis sss
automount: sss
yeah, you’re right, there’s local DNS server running, I think it’s systemd-resolved (running Ubuntu), here’s resolv.conf when tailscale is down:
erik@jojda:~$ cat /etc/resolv.conf
# 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.
nameserver 127.0.0.53
search attlocal.net
And here’s resolv.conf when tailscale is up:
erik@jojda:~$ cat /etc/resolv.conf
# 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.
nameserver 100.100.100.100
nameserver 127.0.0.53
search zasran.gmail.com.beta.tailscale.net attlocal.net
But I am less interested in how it’s working without tailscale and more interested if/how it’s possible to make /etc/hostst work with tailscale
Okay, that makes sense (although it’s a feature of systemd-resolved that I didn’t know about). The correct fix will be an adjustment to tailscale so it can allow your “regular default” nameserver as a fallback, instead of overriding your corp dns settings. Stay tuned! And thanks for the report.