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

IN keyword is not accepted #2167

Open
eirnym opened this issue Mar 7, 2024 · 2 comments
Open

IN keyword is not accepted #2167

eirnym opened this issue Mar 7, 2024 · 2 comments

Comments

@eirnym
Copy link

eirnym commented Mar 7, 2024

Describe the bug

IN keyword beside SOA records is not accepted.

Bind and Knot DNS servers accepts to use CLASS RRs in each line, many zone editors and definitions contain these keyword on each line as well, also it's possible to specify record-specific TTL (which is usually 0, so in most cases it's not worth a while to respond).

please, note that RFCs has mixed opinion on this, so I see it as an optional keywords. There's no RFC to define zone file format

nslookup, dig and many other clients would response with a full line: zone, ttl, class RR value

www.example.com.	86400	IN	A	127.0.0.1

To Reproduce
Steps to reproduce the behavior:

zone can contain IN records will fail

www IN A 127.0.0.1

Expected behavior

no syntax error on class and invalid syntax if invalid class has been specified

System:

  • OS: macOS
  • Architecture: aarch64
  • Version Monterey
  • rustc version: 1.75.0

Version:
Crate: hickory-dns binary
Version: git revision da41e4a

Additional context
Add any other context about the problem here.

@djc
Copy link
Collaborator

djc commented Mar 7, 2024

Thanks for the report! Would you be able to take a whack at fixing this?

The zone file parsing code lives here: https://github.com/hickory-dns/hickory-dns/blob/main/crates/proto/src/serialize/txt/zone.rs.

Would also be great if you can just contribute a PR that adds tests for this.

Happy to answer any questions you might have.

@eirnym
Copy link
Author

eirnym commented Mar 7, 2024

Thanks, I'll try

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