⚡ Sangsakala Proxy 🏠 Home
Skip to content

Resolve relative $ORIGIN and $INCLUDE origins against the current origin - #432

Open
RaphaelFakhri wants to merge 1 commit into
dnsjava:masterfrom
RaphaelFakhri:fix-relative-origin
Open

RaphaelFakhri wants to merge 1 commit into
dnsjava:masterfrom
RaphaelFakhri:fix-relative-origin

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

RFC 1035, Section 5.1 states that a domain name that does not end in a dot is relative to the current origin. Master resolved the name in a $ORIGIN directive, and the optional origin of $INCLUDE, against the root instead. In zone example.com., $ORIGIN sub set the origin to sub. instead of sub.example.com., so every following relative owner name ended up outside the zone. BIND and other zone file parsers append the current origin in this case.

Master now resolves both names against the current origin. If no origin is set, it falls back to the root as before. Absolute names are unchanged.

Tests

  • Added MasterTest.relativeOriginDirective and MasterTest.relativeIncludeOrigin. Both fail on master with expected: a.sub.example.com. but was: a.sub..
  • mvn verify passes, except for ResolverTest.resolverListenerExceptionUnwrap, which also fails on master in the same environment (timeout).

Fixes #431

RFC 1035, section 5.1 states that relative names in a master file are
relative to the current origin. A relative name in a $ORIGIN directive or
in the origin argument of $INCLUDE was resolved against the root instead,
so "$ORIGIN sub" in zone example.com. set the origin to "sub." rather than
"sub.example.com.".

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Relative $ORIGIN in a zone file is resolved against the root instead of the current origin

1 participant