mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[PR #1874] [MERGED] authority: parse with default record class IN. #2668
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#2668
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/1874
Author: @cpu
Created: 1/8/2023
Status: ✅ Merged
Merged: 1/17/2023
Merged by: @bluejekyll
Base:
main← Head:cpu-zone-parse-default-class📝 Commits (3)
e6133feauthority: parse with default record class IN.736d0b6client: unit test default zone class.2db6212tests: add file authority test for default IN.📊 Changes
4 files changed (+64 additions, -1 deletions)
View changed files
📝
crates/client/src/serialize/txt/zone.rs(+33 -0)📝
crates/server/src/store/file/authority.rs(+2 -1)📝
crates/server/tests/store_file_tests.rs(+16 -0)➕
tests/test-data/test_configs/default/implicitclass.zone(+13 -0)📄 Description
Description
Prior to this branch parsing a zone file with
trust-dnsthat did not specify a record class on one or more records would panic with an error with the message "record class not specified":min.toml
zones/example.com
trust-dns -c ./min.toml
On the topic of whether class is optional or not, RFC1035 5.1 says:
Unfortunately this is somewhat ambiguous for the case where no explicit class value has been stated. It appears other software like BIND, knot, and bwesterb/go-zonefile will all assume a class of IN and parse the zone successfully but I can't find chapter and verse in the RFC to justify this.
Change
Assuming the internet class and parsing the zone seems like sensible behaviour, so this branch updates the
try_from_configfunction's call toparsesuch that it defaults to the IN class when not specified, matching the behaviour of other software.Anecdotally I've carried my zone files through ~3 generations of different authoritative DNS servers and this is the first time one has balked. :-) While I can fix my own zones to specify the class I thought it might help others to support an implicit class natively.
I've added a couple small unit tests in 736d0b6 and
2db6212. They're in separate commits to make iteration easier (I'm generally new to working in Rust on larger codebases).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
fileconfiguration parameter #3223