blink/pkg/dns/dns.go
2024-07-20 06:19:34 +01:00

33 lines
668 B
Go

package dns
import (
"math/rand"
"time"
"github.com/miekg/dns"
)
// DNS query
type Query struct {
Client *dns.Client // DNS client
IPv6 bool // IPv6 mode
Resolvers []string // Target resolvers
Domain string // Target domain
Subdomain string // Target subdomain
Results chan<- *Result // Results channel
}
// DNS result
type Result struct {
Domain string // Target domain
Subdomain string // Target subdomain
IPv4 []string // IPv4 hosts
IPv6 []string // IPv6 hosts
Error error // Error response
}
func init() {
// Random seed
rand.New(rand.NewSource(time.Now().UnixNano()))
}