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

Parsing issue with Bind zonefiles #26

Open
hron84 opened this issue Oct 13, 2021 · 2 comments
Open

Parsing issue with Bind zonefiles #26

hron84 opened this issue Oct 13, 2021 · 2 comments

Comments

@hron84
Copy link

hron84 commented Oct 13, 2021

We experienced a weird parsing issue with a normally OK bind zonefile.

The parser expects a SOA record right after the $ORIGIN definition, but it's not always work.

I've a following zone:

$ORIGIN .
$TTL 3600   ; 1 hour
192.168.2.1       IN A    192.168.2.1
router.domain.com A  192.168.2.1
mydomain.com     SOA ns.domain.com. hostmaster.domain.com. (
                26         ; serial
                900        ; refresh (15 minutes)
                600        ; retry (10 minutes)
                86400      ; expire (1 day)
                3600       ; minimum (1 hour)
                )

And it works totally fine with Bind but DNS::Zonefile fails to parse it.

@aeden
Copy link
Owner

aeden commented Nov 24, 2022

The current zone parsing rule (https://github.com/craigw/dns-zonefile/blob/master/lib/dns/zonefile.treetop#L3) requires a non-optional SOA resource record (RR) to appear after one or more optional variables, space_or_break, or comment non-terminal symbols. I'd like to fix this as well, and I'm in the code now working on support for TTL and class reordering, so I'll see if I can find a way to allow the SOA RR to appear anywhere other RR can.

@aeden
Copy link
Owner

aeden commented Nov 24, 2022

I was not able to figure out yet how to do away with the separate soa definition that needs to be the first record in a zone. I may be able to come back to it in the future though, so I'll leave this open.

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