5 ms·
The DNS "master file"/"zone file" format is a bloody disaster for the same reason, and practically unparseable. Every implementation parses them differently wh
by nly 4y ago
The DNS "master file"/"zone file" format is a bloody disaster for the same reason, and practically unparseable. Every implementation parses them differently when it comes to parenthesis.
From the grammar in RFC 1035:
<domain-name><rr> [<comment>]
<blank><rr> [<comment>]
<rr> contents take one of the following forms:
[<TTL>] [<class>] <type> <RDATA>
[<class>] [<TTL>] <type> <RDATA>
All the columns being optional creates the ambiguity between the <class> and <domain-name> columns in the TTL missing/2nd form. In the real world <class> is always "IN". It's even worse since the set of <type>'s is unbounded and the <RDATA> grammar depends on <type>
I believe this is one reason why tinydns has its own format https://cr.yp.to/djbdns/tinydns-data.html https://cr.yp.to/djbdns/tinydns-data.html
- jandrese 4y agoBind's config files are awful. I think it is like Sendmail where the only reason it is still awful is that there is too much infrastructure built around them to make them better. They could improve the configs, but it might break many thousands of scripts around the world. Back in the 80s there were not many examples of configuration files, so everybody just invented their own idiosyncratic format. Most of those old formats have long since died off, but a few have survived to haunt us even today.
- h2odragon 4y agosendmail.cf is bytecode. At the time it was written, bytes mattered, and it did a magnificent job. Now we have the resources to make things easier on humans. but there really should be some sort of charity foundation to help the victims of sendmail.cf trauma.
- aldrich 4y agoYeah, though I would say human readable bytecode, and it is interesting to see that in the actual context. For anyone who's interested, there's a git repository containing a historical reconstruction of the original BSDs. I believe one of the first BSD versions containing sendmail (by Eric Allman) is this one: https://github.com/weiss/original-bsd/blob/bd282c88c1b3c2575b96e2c181085233f7b15786/usr.sbin/sendmail/READ_ME https://github.com/weiss/original-bsd/blob/bd282c88c1b3c2575... (almost 40 years ago!) Its a little hard to read due to the format, but here's some explanation of the (1983, earliest?) config file that was used back then: https://github.com/weiss/original-bsd/blob/bd282c88c1b3c2575b96e2c181085233f7b15786/usr.sbin/sendmail/doc/intro/intro.me#L488 https://github.com/weiss/original-bsd/blob/bd282c88c1b3c2575... From what I grasp, it started as an extensive dynamic parser that needed to understand a lot of rules, and I guess with each new RFC and version, the rules needed to be extended too. And the config file could be loaded into a memory image to improve performance.
- teknopaul 4y agoIt's not that bad. You may have to rtfm, but only once.
- jandrese 4y agoI have to RTFM every time I get asked to write a Bind config.
- icedchai 4y agoI've been running BIND since 1995. Most configurations are very similar. A zone is either primary / master or secondary / slave. You copy and paste from a previous config entry, change a zone name, maybe add an extra secondary name server now and then.
- thayne 4y agoAlso, the zone file format is defined by an RFC. Which is why several a lot if DNS software uses that format, not just bind. Bind in particular, is conservative about deviating from the standardized format.
- nly 4y agoExample in PowerDNS, where the allowance for the "IN" class is hard-coded to remove ambiguity: https://github.com/PowerDNS/pdns/blob/master/pdns/zoneparser-tng.cc#L40 https://github.com/PowerDNS/pdns/blob/master/pdns/zoneparser... And in BIND where the <rdata> parsing is coded up for a bunch of <type>'s: https://github.com/isc-projects/bind9/tree/main/lib/dns/rdata/in_1 https://github.com/isc-projects/bind9/tree/main/lib/dns/rdat...
- js2 4y agoBIND's zone files are an implementation detail completely unnecessary to interoperate with the DNS protocol. Same for zone-transfers. Neither of these ever belonged in an RFC in the first place.
- Anthony-G 4y agoWhen I worked with MS Windows DNS server a few years ago, I was surprised to see that it stored domain information in (temporary?) files with a format very similar to that of BIND zone files (I can’t remember if the Windows server was primary or secondary for that domain). Regarding zone transfers, I think it makes sense that the AXFR and IXFR protocols are specified in RFCs. Neither the server nor client should care about what software is used by the other host to implement the agreed protocols.
- icedchai 4y agoKeeping your secondary name server(s) in sync is necessary if you want things to work reliably. Zone transfers are necessary. File formats are not.
- js2 4y agoThere’s a lot of ways to replicate zone data of which zone transfers are the worst. I’ve never used the protocol. Use scp or rsync.
- icedchai 4y agoWhat’s wrong with them? I’ve been using them for 25 years. Zone transfers are built in and “just work” once you set it up.
- js2 4y agoSo I did used to use the axfrs back when I used to use bind. It’s clear text. It requires updating a serial number for no other reason than for the client to know to update. It’s based on polling. It exposes more complexity in the server that isn’t needed. It’s an archaic and dumb protocol. There’s nothing wrong with it in the same way there was nothing wrong with telnet or ftp. https://cr.yp.to/djbdns/axfr-notes.html https://cr.yp.to/djbdns/axfr-notes.html
- deleted 4y ago[deleted]