Add an opt-in rfc2308_ttl mode for TTL inheritance - #1300
Open
peterthomassen wants to merge 1 commit into
Open
Conversation
Owner
|
Given how old RFC 2308 is, and that no one likely wants the old behavior, I wonder if we should look at this as a bug and make the default True, even though that will have a backwards compatibility impact, at least in theory. |
Contributor
Author
|
Yes, that's why I was hesitating. I guess the only reason to keep the current behavior really is backwards compatibility. I wouldn't mind making the new one the default, but I guess that would require a 2.9 release and an additional warning in the release notes or something. Your call! |
Owner
|
2.9 is coming in a week or two, so my vote is to make the proper behavior the default and add a note to whatsnew.rst. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Folks complaining about this:
Pre-RFC 2308 master files overloaded the SOA MINIMUM field to mean "default TTL for the zone". This is what dnspython does: a record with no TTL takes the SOA minimum whenever no
$TTLdirective has been seen. RFC 2308 section 4 removed that meaning of MINIMUM, leaving RFC 1035 section 5.1 (which says that a record without TTL inherits the most recently stated one).This PR adds an
rfc2308_ttlparameter (defaultFalse) todns.zone.from_text(),dns.zone.from_file(),dns.zonefile.read_rrsets(), anddns.zonefile.Reader, which selects the RFC 2308 interpretation. An explicit default ($TTLordefault_ttl/force_ttl) still wins in either mode, and the SOA minimum is still used as a last resort when nothing else has stated a TTL at all, so a zone whose only TTL is the SOA minimum parses identically in both modes.How it works: the reader now tracks whether the current default TTL comes from SOA MINIMUM (
default_ttl_from_soa, cleared by$TTLand saved/restored across$INCLUDEalongside the other TTL state), and the three places that resolved an missing TTL now use a single_implicit_ttl()helper instead of each open-coding the precedence. With the flag off, the resolved TTL is unchanged in every reachable state, so existing behavior is preserved.