16 lines
322 B
Go
16 lines
322 B
Go
package helpers
|
|
|
|
import (
|
|
"github.com/domainr/dnsr"
|
|
)
|
|
|
|
func ResolveRecord(recordName, recordType string) []string {
|
|
var records []string
|
|
|
|
r := dnsr.NewResolver(dnsr.WithCache(1000), dnsr.WithTCPRetry())
|
|
for _, rr := range r.Resolve(recordName, recordType) {
|
|
records = append(records, rr.Value)
|
|
}
|
|
|
|
return records
|
|
}
|