-
Notifications
You must be signed in to change notification settings - Fork 9
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
Zone file comments #2
Comments
Hi @nalberti! I couldn't find any grammar in the BIND documentation exactly where those comment styles are allowed, though. They aren't even mentioned in the zone file section. Did you find something about this? There's potential for making parsing a bit harder if you can have something like |
After some testing, it appears BIND does not accept |
I see what you mean.. I just read though the BIND Admin guide to see if there was anything specific to zone files however it only appears to detail comments as they generally relate to configuration files. My interpretation is that includes zone files however your test indicate otherwise. The only guess I have is the examples show a space post/pre "*", I wonder if that makes the difference. Here is a relevant excerpt; http://web.mit.edu/darwin/src/modules/bind/bind/doc/html/comments.html |
I had a short discussion about this, So, in the general case it would be correct to do nothing and expect the user to filter the files. However, since BIND does this, I believe this utility could do the filtering as well before passing it off to the (technically correct) parser. EDIT: BIND is not doing the wrong thing - it is doing exactly it is being asked, and just what I explained above. Resolving |
Hahah, wow, you are indeed correct! I double checked and BIND is indeed serving the record #host.ourdomain.com in our public DNS! So I agree with your suggestion that its just the Terraform resource name not supporting what is a valid host name character that is the issue. Honestly, I doubt this issue would ever come up again, just based on the rarity of having a "#" as part of a host name and/or the widespread use of hash commented zone files. |
@nalberti Would you mind giving this version a try and see if it works for you? https://6-61497387-gh.circle-artifacts.com/0/bzfttr53rdutil |
Appears to work fine, I tested on 3 different zone files of my own and 2 random/sample ones found online. The output was identical, verified by file size and diff. Terraform plan also ran against the output fine. Anything else you would specifically like me to test or further information ? |
Great, thanks a lot! That should be enough validation, I'll go ahead and merge and create a new release :) |
Fixes #2. Also refactors a lot, in order to be able to test
Hi,
First of all THANK YOU! this saved me a heap of time converting zone files!
I just noticed a small error on conversion though, we have some zone files commented with a leading "#", checking the bind zone file syntax the following are valid;
An example of the current output when # commented record is processed is;
This results in an Terraform error
Error: aws_route53_record.#host-domain-com-CNAME: #host-domain-com-CNAME: resource name can only contain letters, numbers, dashes, and underscores.
Obviously this is just because of the "#" in the record name and record can/should be skipped/ignored.
The text was updated successfully, but these errors were encountered: