2024-07-08 01:04:54 +00:00
|
|
|
package dns
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/rand"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/miekg/dns"
|
|
|
|
)
|
|
|
|
|
|
|
|
// DNS query
|
|
|
|
type Query struct {
|
|
|
|
Client *dns.Client // DNS client
|
2024-07-09 18:17:34 +00:00
|
|
|
IPv6 bool // IPv6 mode
|
2024-07-09 18:27:00 +00:00
|
|
|
Verify bool // Verify mode
|
2024-07-08 01:04:54 +00:00
|
|
|
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
|
2024-07-09 16:54:15 +00:00
|
|
|
IPv4 []string // IPv4 hosts
|
|
|
|
IPv6 []string // IPv6 hosts
|
2024-07-08 01:04:54 +00:00
|
|
|
Error error // Error response
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
// Random seed
|
|
|
|
rand.New(rand.NewSource(time.Now().UnixNano()))
|
|
|
|
}
|