diff --git a/main.go b/main.go index c19c265..d1bff34 100644 --- a/main.go +++ b/main.go @@ -98,7 +98,11 @@ func run(args []string) (opts *util.Options, code int, err error) { https://pkg.go.dev/github.com/miekg/dns@v1.1.50 */ - _ = resp.DNS.Answer[r.Intn(len(resp.DNS.Answer))] + if opts.Request.Name == "." { + opts.Request.Server = resp.DNS.Answer[r.Intn(len(resp.DNS.Answer))].Header().Name + } else { + opts.Request.Server = resp.DNS.Answer[r.Intn(len(resp.DNS.Ns))].Header().Name + } opts.TLS = false opts.HTTPS = false