Replace flat with "@" + implement vars with "$" + add special type "A+AAAA" + resolver (cache, retry, multi-results)
This commit is contained in:
parent
e1fc586076
commit
d145ffa61a
4 changed files with 204 additions and 70 deletions
|
|
@ -4,11 +4,13 @@ import (
|
|||
"github.com/domainr/dnsr"
|
||||
)
|
||||
|
||||
func ResolveRecord(recordName, recordType string) string {
|
||||
r := dnsr.NewResolver(dnsr.WithCache(0))
|
||||
func ResolveRecord(recordName, recordType string) []string {
|
||||
var records []string
|
||||
|
||||
r := dnsr.NewResolver(dnsr.WithCache(1000), dnsr.WithTCPRetry())
|
||||
for _, rr := range r.Resolve(recordName, recordType) {
|
||||
return rr.Value
|
||||
records = append(records, rr.Value)
|
||||
}
|
||||
|
||||
return ""
|
||||
return records
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue