replace default go resolver with caching resolver

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-12-03 01:11:08 +03:00
parent 36b7b9f5fb
commit bf4143cde5
5 changed files with 581 additions and 5 deletions

16
util/dns/cache_test.go Normal file
View File

@@ -0,0 +1,16 @@
package dns
import (
"net"
"testing"
)
func TestCache(t *testing.T) {
net.DefaultResolver = NewNetResolver(PreferIPV4(true))
addrs, err := net.LookupHost("unistack.org")
if err != nil {
t.Fatal(err)
}
t.Logf("addrs %v", addrs)
}