mirror of
https://github.com/miekg/dns.git
synced 2025-08-20 16:31:00 +02:00
The example test performs an axfr, but as ixfr differs slightly it should also support ixfr
25 lines
431 B
Go
25 lines
431 B
Go
package resolver
|
|
|
|
import (
|
|
"testing"
|
|
"fmt"
|
|
"dns"
|
|
)
|
|
|
|
|
|
func TestAXFR(t *testing.T) {
|
|
res := new(Resolver)
|
|
ch := NewXfer(res)
|
|
|
|
res.Servers = []string{"127.0.0.1"}
|
|
m := new(dns.Msg)
|
|
m.Question = make([]dns.Question, 1)
|
|
// ask something
|
|
m.Question[0] = dns.Question{"miek.nl", dns.TypeAXFR, dns.ClassINET}
|
|
|
|
ch <- DnsMsg{m, nil}
|
|
for dm := range ch {
|
|
fmt.Printf("%v\n",dm.Dns)
|
|
}
|
|
}
|