You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I was checking your library for parsing a zone with generic representation and it seems that or I'm doing something wrong, or something is broken. If we have this code (called test-parser.go) that reads a zone file and print the RRs:
package main
import (
"fmt"
"os"
"github.com/miekg/dns"
)
func main () {
zonefile := os.Args[1]
fd, _ := os.Open(zonefile)
defer fd.Close()
zone := dns.NewZoneParser(fd,"","")
for rr, ok := zone.Next(); ok; rr, ok = zone.Next() {
fmt.Println(rr)
}
}
and having this simple.zone file:
example. 86400 IN NS ns.example.
example. 86400 IN SOA ns.example. admin.example. 2018031900 18
00 900 604800 86400
ns.example. 3600 IN A 127.0.0.1
example. 3600 IN A 127.0.0.2
It is printed correctly with $ go run test-parser.go simple.zone
But, if I change the last line for the Hex representation using: perl -MNet::DNS::RR -e '$rr = new Net::DNS::RR("example. 3600 IN A 127.0.0.2");print $rr->generic;'
Which gives me the simple.zone file:
example. 86400 IN NS ns.example.
example. 86400 IN SOA ns.example. admin.example. 2018031900 18
00 900 604800 86400
ns.example. 3600 IN A 127.0.0.1
example. 3600 CLASS1 TYPE1 \# 4 7f000002
Then, running the code i will have:
$ go run test-parser.go simple.zone
example. 86400 IN NS ns.example.
example. 86400 IN SOA ns.example. admin.example. 2018031900 1800 900 604800 86400
ns.example. 3600 IN A 127.0.0.1
The text was updated successfully, but these errors were encountered:
Hi,
I was checking your library for parsing a zone with generic representation and it seems that or I'm doing something wrong, or something is broken. If we have this code (called test-parser.go) that reads a zone file and print the RRs:
and having this simple.zone file:
It is printed correctly with
$ go run test-parser.go simple.zone
But, if I change the last line for the Hex representation using:
perl -MNet::DNS::RR -e '$rr = new Net::DNS::RR("example. 3600 IN A 127.0.0.2");print $rr->generic;'
Which gives me the simple.zone file:
Then, running the code i will have:
The text was updated successfully, but these errors were encountered: