Browse Source

handle looking up hostmaster SOA records

master
Brett Langdon 10 years ago
parent
commit
2444caea3b
1 changed files with 16 additions and 2 deletions
  1. +16
    -2
      zone.go

+ 16
- 2
zone.go View File

@ -51,8 +51,22 @@ func (zone *Zone) Lookup(name string, reqType uint16, reqClass uint16) []dns.RR
var header *dns.RR_Header
header = record.Header()
// Skip this record if the name or class do not match
if header.Name != name || (header.Class != reqClass && reqClass != dns.ClassANY) {
// Skip this record if the class does not match up
if header.Class != reqClass && reqClass != dns.ClassANY {
continue
}
// If this record is an SOA then check name against Mbox
if header.Rrtype == dns.TypeSOA {
var soa *dns.SOA
soa = record.(*dns.SOA)
if soa.Mbox == name {
records = append(records, soa)
}
}
// Skip this record if the name does not match
if header.Name != name {
continue
}


Loading…
Cancel
Save