net/dns/{publicdns,resolver}: add start of Control D support

Updates #7946

[@bradfitz fixed up version of #8417]

Change-Id: I1dbf6fa8d525b25c0d7ad5c559a7f937c3cd142a
Signed-off-by: alexelisenko <39712468+alexelisenko@users.noreply.github.com>
Signed-off-by: Alex Paguis <alex@windscribe.com>
This commit is contained in:
alexelisenko
2023-06-22 20:47:36 -04:00
committed by Brad Fitzpatrick
parent aa084a29c6
commit fe22032fb3
3 changed files with 109 additions and 5 deletions

View File

@@ -116,6 +116,24 @@ func TestDoHIPsOfBase(t *testing.T) {
"2a07:a8c1::c3:a884",
),
},
{
base: "https://dns.controld.com/hyq3ipr2ct",
want: ips(
"76.76.2.22",
"76.76.10.22",
"2a07:a8c0:0:6:7b5b:5949:35ad:0",
"2a07:a8c1:0:6:7b5b:5949:35ad:0",
),
},
{
base: "https://dns.controld.com/112233445566778899aabbcc",
want: ips(
"76.76.2.22",
"76.76.10.22",
"2a07:a8c0:0:ffff:ffff:ffff:ffff:0",
"2a07:a8c1:0:ffff:ffff:ffff:ffff:0",
),
},
}
for _, tt := range tests {
got := DoHIPsOfBase(tt.base)