dns: ZoneParser error with "TSIG" records
When using dns.NewZoneParser() on a zone file, I get the following error:
dns: unknown RR type: "TSIG" at line: 433:36
Line 433 of the zone file contains the following line:
monitor.reg.neustar.com. 0 ANY TSIG hmac-md5.sig-alg.reg.int. 1541638220 300 16 Cocdc1taK0N1SnSb4sohRQ== 4270 NOERROR 0
Is this a bug? For the purposes of my project I currently don’t care about TSIG records, would it be possible to tell the parser to ignore records it does not support?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (12 by maintainers)
[ Quoting notifications@github.com in “Re: [miekg/dns] ZoneParser error wi…” ]
Sure, and now its offloadig the (liberal) decision to infect this library.
Also sure: but it hasn’t today, so it’s illegal, please use RFC 3597 syntax.
This issue is very good at highlighting which registries have absolutely no clue what they are doing.
👍 for this library parsing zone files, and not zone files and also text files that resemble zone files.
[ Quoting notifications@github.com in “Re: [miekg/dns] ZoneParser error wi…” ]
this is plain wrong:
The Flags and Services and Regexp fields are all quoted <character-string>s.
https://tools.ietf.org/html/rfc2915#section-9. Those fields are not quoted so that is an error.
Ignoring unknown RRs may be an option, but sounds dangerous so I’m not a fan it doing that.
I don’t know what ICANN is serving you, but it’s certainly not well formed zones.
/Miek
– Miek Gieben
[ Quoting notifications@github.com in “Re: [miekg/dns] ZoneParser error wi…” ]
you’re not getting a zonefile, your getting an axfr with a transaction signature attached. Those are 2 different things. TSIG has no meaning in a zone and doesn’t have a text representation, so it errors.
you need to strip the TSIG, just as you (probably) need to drop the second SOA, although the parser happily returns that second one.
/Miek
– Miek Gieben
Without a TSIG presentation format this is WAI; we discarding invalid zone.
TSIG needs an RFC which will be trivial; so this is your change to engage in the IETF process 😃
Meanwhile closing this as Works As Intended
I’m not willing to implement the same.
You need to read it with bind and then write it out again to clean. Then you can read it again using this library and process
On Wed, 21 Nov 2018, 18:38 Miek Gieben <miek@miek.nl wrote: