This is a completed DNS proxy.
Like example as cmd/dnsproxy
go get github.com/Asphaltt/dnsproxy-go
and use the library in your project.
cfg := &dnsproxy.Config{
Addr: ":53",
UpServers: []string{"8.8.8.8"},
WithCache: true,
CacheFile: "cache.json",
WorkerPoolMin: 100,
WorkerPoolMax: 1000,
}
if err := dnsproxy.Start(cfg); err != nil {
return
}
defer dnsproxy.Close()
Or you can compile cmd/dnsproxy
to run as a dns proxy server.