Replace flat with "@" + implement vars with "$" + add special type "A+AAAA" + resolver (cache, retry, multi-results)

This commit is contained in:
William Bouzourène 2025-03-27 12:53:02 +01:00
parent e1fc586076
commit d145ffa61a
4 changed files with 204 additions and 70 deletions

View file

@ -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
}