tailscale/net/dns
Brad Fitzpatrick 58abae1f83 net/dns/{publicdns,resolver}: add NextDNS DoH support
NextDNS is unique in that users create accounts and then get
user-specific DNS IPs & DoH URLs.

For DoH, the customer ID is in the URL path.

For IPv6, the IP address includes the customer ID in the lower bits.

For IPv4, there's a fragile "IP linking" mechanism to associate your
public IPv4 with an assigned NextDNS IPv4 and that tuple maps to your
customer ID.

We don't use the IP linking mechanism.

Instead, NextDNS is DoH-only. Which means using NextDNS necessarily
shunts all DNS traffic through 100.100.100.100 (programming the OS to
use 100.100.100.100 as the global resolver) because operating systems
can't usually do DoH themselves.

Once it's in Tailscale's DoH client, we then connect out to the known
NextDNS IPv4/IPv6 anycast addresses.

If the control plane sends the client a NextDNS IPv6 address, we then
map it to the corresponding NextDNS DoH with the same client ID, and
we dial that DoH server using the combination of v4/v6 anycast IPs.

Updates #2452

Change-Id: I3439d798d21d5fc9df5a2701839910f5bef85463
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-09-08 12:50:32 -07:00
..
publicdns net/dns/{publicdns,resolver}: add NextDNS DoH support 2022-09-08 12:50:32 -07:00
resolvconffile all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
resolver net/dns/{publicdns,resolver}: add NextDNS DoH support 2022-09-08 12:50:32 -07:00
config.go net/dns/{publicdns,resolver}: add NextDNS DoH support 2022-09-08 12:50:32 -07:00
debian_resolvconf.go all: gofmt with Go 1.17 2021-08-05 15:54:00 -07:00
direct.go all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
direct_test.go all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
flush_default.go wgengine: flush DNS cache after major link change. 2021-09-19 22:58:53 -07:00
flush_windows.go wgengine: flush DNS cache after major link change. 2021-09-19 22:58:53 -07:00
ini.go all: gofmt with Go 1.17 2021-08-05 15:54:00 -07:00
ini_test.go all: gofmt -w -s (simplify) tests 2021-12-15 08:43:41 -08:00
manager.go net/dns/{publicdns,resolver}: add NextDNS DoH support 2022-09-08 12:50:32 -07:00
manager_darwin.go net/dns: add tailscaled-on-macOS DNS OSConfigurator 2022-04-23 20:43:41 -07:00
manager_default.go net/dns: add tailscaled-on-macOS DNS OSConfigurator 2022-04-23 20:43:41 -07:00
manager_freebsd.go net/dns: fall back to copy+delete/truncate if moving to/from /etc/resolv.conf fails. 2021-10-26 09:03:37 -07:00
manager_linux.go net/dns: remove systemd-resolved ping 2022-07-27 14:15:22 -07:00
manager_linux_test.go net/dns: remove systemd-resolved ping 2022-07-27 14:15:22 -07:00
manager_openbsd.go net/dns: teach OpenBSD's manager to talk to resolvd(8). (#2789) 2022-01-11 08:45:50 -08:00
manager_tcp_test.go all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
manager_test.go net/dns/{publicdns,resolver}: add NextDNS DoH support 2022-09-08 12:50:32 -07:00
manager_windows.go go.mod: bump wireguard/windows, which moves to using net/netip 2022-08-31 08:36:56 -07:00
manager_windows_test.go net/dns: [win] add MagicDNS entries to etc/hosts 2022-08-19 12:38:11 -05:00
nm.go all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
noop.go net/dns: return error from NewOSManager, use it to initialize NM. 2021-04-12 15:51:37 -07:00
nrpt_windows.go all: use syncs.AtomicValue 2022-08-04 11:52:16 -07:00
openresolv.go all: gofmt with Go 1.17 2021-08-05 15:54:00 -07:00
osconfig.go net/dns: [win] add MagicDNS entries to etc/hosts 2022-08-19 12:38:11 -05:00
resolvconf-workaround.sh net/dns: also include 'tail' and 'base' files when fixing up resolv.conf. 2021-04-10 23:01:11 -07:00
resolvconf.go net/dns: exhaustively test DNS selection paths for linux. 2021-09-04 23:40:48 -07:00
resolvd.go net/dns/resolvconffile: unify three /etc/resolv.conf parsers into new package 2022-02-14 20:55:57 -08:00
resolved.go all: gofmt for Go 1.19 2022-08-02 10:08:05 -07:00
utf.go net/dns: detect and decode UTF-16 from wsl.exe earlier. 2021-11-30 13:10:18 -08:00
utf_test.go net/dns: detect and decode UTF-16 from wsl.exe earlier. 2021-11-30 13:10:18 -08:00
wsl_windows.go net/dns: fix checking for wrapped error when attempting to read wsl.conf for Windows WSL2 2021-11-30 15:36:39 -07:00