2 ms·
The DNS zone text file format is the most horrific, loosely specified thing to parse I did some experiments a number of years ago and found almost none of the
by nly 5y ago
The DNS zone text file format is the most horrific, loosely specified thing to parse
I did some experiments a number of years ago and found almost none of the DNS server software out there parses zone files the same, particularly surrounding parenthesis, line wrapping, and unknown record types.
- Anthony-G 5y agoI discovered this when I wrote a Vim function to automatically update the serial of the SOA record (can be easy to forget if in a hurry) whenever I saved a zone file. It worked fine for my own zone files, similar to: $ORIGIN example.com. @ IN SOA ns.example.info. hostmaster.example.info. ( 2021031306 ; Serial 12h ; Refresh (secondary server accepts zone update notifications) 2h ; Retry (how long secondary should wait before retrying) 14d ; Expire (how long records should be considered valid by secondary) 1h ; NXDOMAIN (Nonexistent domain) TTL – previously the Minimum TTL ) I considered publishing my Vim script but figured I should improve it so that it would work for all valid zone files. Then I read the Master Files section of RFC 1035¹ and realised that this would be more difficult than I had assumed. I’m also not particularly proficient with Vimscript so I never published it. Since then, I’ve converted my zones to be dynamic so I don’t need to worry about formatting or updating the serial. Out of interest, which name server had the most robust parsing of zone files? 1. https://tools.ietf.org/html/rfc1035#section-5 https://tools.ietf.org/html/rfc1035#section-5
- nly 5y agoRobustness is irrelevant, because whenever there is a hole in the various specs people ask "What is BIND doing?"