tailscale/net
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
..
dns net/dns/{publicdns,resolver}: add NextDNS DoH support 2022-09-08 12:50:32 -07:00
dnscache net/dnscache: use net/netip 2022-09-01 17:54:19 -04:00
dnsfallback net/dnsfallback: allow setting log function (#5550) 2022-09-06 11:19:50 -04:00
flowtrack all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
interfaces go.mod: bump wireguard/windows, which moves to using net/netip 2022-08-31 08:36:56 -07:00
netaddr all: migrate code from netaddr.FromStdAddr to Go 1.18 2022-08-02 22:25:07 -07:00
netcheck net/stun: convert to use net/netip.AddrPort 2022-08-15 12:46:01 -04:00
neterror net/{neterror,dns/resolver}: move PacketWasTruncated to neterror from DNS code 2022-01-03 14:03:30 -08:00
netknob all: disable TCP keep-alives on iOS/Android 2021-09-28 12:03:18 -07:00
netns syncs, all: move to using Go's new atomic types instead of ours 2022-08-04 07:47:59 -07:00
netstat all: migrate more code code to net/netip directly 2022-08-02 13:59:57 -07:00
nettest net/nettest: deflake TestPipeTimeout 2021-11-30 12:21:59 -08:00
netutil all: convert more code to use net/netip directly 2022-07-25 21:53:49 -07:00
packet all: migrate more code code to net/netip directly 2022-08-02 13:59:57 -07:00
ping net/netcheck: try ICMP if UDP is blocked (#5056) 2022-08-04 17:10:13 -04:00
portmapper syncs, all: move to using Go's new atomic types instead of ours 2022-08-04 07:47:59 -07:00
proxymux net/proxymux: add a listener mux that can run SOCKS and HTTP on a single socket. 2021-11-29 16:49:48 -08:00
socks5 net/socks5: use new Go 1.19 binary.AppendByteOrder.AppendUintX 2022-08-05 08:30:48 -07:00
speedtest all: fix spelling mistakes 2021-10-12 21:23:14 -07:00
stun net/stun: convert to use net/netip.AddrPort 2022-08-15 12:46:01 -04:00
tlsdial all: gofmt for Go 1.19 2022-08-02 10:08:05 -07:00
tsaddr all: migrate more code code to net/netip directly 2022-08-02 13:59:57 -07:00
tsdial all: use syncs.AtomicValue 2022-08-04 11:52:16 -07:00
tshttpproxy all: use syncs.AtomicValue 2022-08-04 11:52:16 -07:00
tstun all: use syncs.AtomicValue 2022-08-04 11:52:16 -07:00