ossobv / dnsgit

Keep track of DNS server history using a Git repository
GNU General Public License v3.0
8 stars 0 forks source link

Case sensitivity issue possible workaround #3

Open falz opened 6 months ago

falz commented 6 months ago

As noted in the comment in the code, there's an issue with some records toggling between upper and lowercase

https://github.com/PowerDNS/pdns/issues/4690

This started to bug us, as a workaround we decided to convert everything to lower using tr command in script.

Changed

info=$(dig AXFR "$1" @"$AXFR_HOST" +nocomments +nostats +multi +rrcomments +onesoa)

to

info=$(dig AXFR "$1" @"$AXFR_HOST" +nocomments +nostats +multi +rrcomments +onesoa | tr '[:upper:]' '[:lower:]')
wdoekes commented 6 months ago

Hm.. besides that it makes the backups of (dnssec) DNSKEY, DS, NSEC3, RRSIG records unusable, which you may not care for, it also breaks TXT records with base64 encoded binary content, like DKIM public keys.

So, that quick fix is a little too quick for my taste.

In our case, making sure everything was the right case in the DB fixed things for good, so I didn't bother looking for better workarounds.

falz commented 6 months ago

Thanks for pointing this out, then indeed my 'fix' is not a agreat idea if one wants recoverable data. If one wants to 'view changes' it's moderately ok.

I'll dig a bit deeper as to why we're having this issue - the case I linked to talks about BIND specifically, which we aren't using. We are secondary for some people and it's possible that they're using BIND.