Add axfr example prog

This commit is contained in:
Miek Gieben 2011-01-01 19:10:07 +01:00
parent b4a69fad37
commit 9b595ed836
3 changed files with 30 additions and 1 deletions

8
_examples/axfr/Makefile Normal file
View File

@ -0,0 +1,8 @@
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
include $(GOROOT)/src/Make.inc
TARG=axfr
GOFILES=axfr.go
DEPS=../../
include $(GOROOT)/src/Make.cmd

22
_examples/axfr/axfr.go Normal file
View File

@ -0,0 +1,22 @@
package main
import (
"fmt"
"dns"
"dns/resolver"
)
func main() {
res := new(resolver.Resolver)
ch := res.NewXfer()
res.Servers = []string{"127.0.0.1"}
m := new(dns.Msg)
m.Question = make([]dns.Question, 1)
m.Question[0] = dns.Question{"atoom.net", dns.TypeAXFR, dns.ClassINET}
ch <- resolver.DnsMsg{m, nil}
for dm := range ch {
fmt.Printf("%v\n",dm.Dns)
}
}

View File

@ -8,5 +8,4 @@ TARG=dns/resolver
GOFILES=\
resolver.go\
#DEPS=../
include $(GOROOT)/src/Make.pkg