Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlignedRdataFormatters::TXT() breaks Google site verification #117

Open
laszlof opened this issue Jul 21, 2023 · 1 comment
Open

AlignedRdataFormatters::TXT() breaks Google site verification #117

laszlof opened this issue Jul 21, 2023 · 1 comment

Comments

@laszlof
Copy link

laszlof commented Jul 21, 2023

Since moving over to using this library for some of our DNS handling, we've notice that google site verification is now broken for new domains.

This appears to be due to the fact that the above mentioned method is splitting the TXT records at 40 characters, presumably just for easier readability.

This results in split strings in the resulting record. From what I can gather, they should be concat'ing these strings together, but that does not appear to be happening.

After further reading, I found RFC4408, section 3.1.3. However, this specific RFC only related to SPF-type TXT records, and not general validation records such as the one used for Google Site Verification.

I've illustrated the issue below:

$ dig franklaszlo.com txt +short
"google-site-verification=FNI0xUTGqcdI8YX" "xaPf_3mj33BYnNtY23ddD2Zl1ECc"
$ grep -C2 site-verification zones/f/franklaszlo.com 
; TXT RECORDS
@                   300   IN TXT   ( 
                                     "google-site-verification=FNI0xUTGqcdI8YX"
                                     "xaPf_3mj33BYnNtY23ddD2Zl1ECc"
                                   )

Screenshot 2023-07-21 at 10 31 59 AM

I'm not sure what the best fix here is, other than changing the split to be the max, 255 characters, for TXT records.

Let me know if you need further information

@samuelwilliams
Copy link
Contributor

Hi @laszlof

The simplest path forward is to just use the ZoneBuilder class instead of the AlignedBuilder to render the zone.

Another option is to override the default TXT formatter with your own implementation AlignedBuilder->addRdataFormatter(). See Docs: AlignedZoneBuilder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants