Skip to content

Commit

Permalink
Add LookupNS
Browse files Browse the repository at this point in the history
  • Loading branch information
miekg committed Jun 23, 2013
1 parent 2e55bd3 commit a232087
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ func (u *Unbound) LookupMX(name string) (mx []*dns.MX, err error) {
return
}

// LookupNS returns the DNS NS records for the given domain name.
func (u *Unbound) LookupNS(name string) (ns []*dns.NS, err error) {
r, err := u.Resolve(name, dns.TypeNS, dns.ClassINET)
if err != nil {
return nil, err
}
for _, rr := range r.Rr {
ns = append(ns, rr.(*dns.NS))
}
return
}

// LookupSRV tries to resolve an SRV query of the given service, protocol,
// and domain name. The proto is "tcp" or "udp". The returned records are
// sorted by priority and randomized by weight within a priority.
Expand Down

0 comments on commit a232087

Please sign in to comment.