mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-26 02:29:28 +00:00
net/dns/publicdns: support NextDNS DoH URLs with path parameters
Updates #2452 Change-Id: I0f1c34cc1672e87e7efd0adfe4088724dd0de3ed Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
b302742137
commit
c14361e70e
@@ -80,6 +80,10 @@ func DoHIPsOfBase(dohBase string) []netip.Addr {
|
||||
return s
|
||||
}
|
||||
if hexStr, ok := strs.CutPrefix(dohBase, "https://dns.nextdns.io/"); ok {
|
||||
// The path is of the form /<profile-hex>[/<hostname>/<model>/<device id>...]
|
||||
// but only the <profile-hex> is required. Ignore the rest:
|
||||
hexStr, _, _ = strings.Cut(hexStr, "/") // discard any optional
|
||||
|
||||
// TODO(bradfitz): using the NextDNS anycast addresses works but is not
|
||||
// ideal. Some of their regions have better latency via a non-anycast IP
|
||||
// which we could get by first resolving A/AAAA "dns.nextdns.io" over
|
||||
|
||||
Reference in New Issue
Block a user