⚡ Sangsakala Proxy 🏠 Home
Skip to content

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

Open

Description

@RaphaelFakhri

Master resolves a relative name in a $ORIGIN directive against the root zone instead of against the current origin. The same applies to the optional origin argument of $INCLUDE.

RFC 1035, Section 5.1: "Domain names that do not end in a dot are called relative; the actual domain name is the concatenation of the relative part with an origin specified in a $ORIGIN, $INCLUDE, or as an argument to the master file loading routine." BIND appends the current origin to a relative $ORIGIN as well.

Steps to reproduce

String zone = "$ORIGIN sub\na 3600 IN A 192.0.2.1\n";
try (Master m = new Master(new ByteArrayInputStream(zone.getBytes()), Name.fromString("example.com."))) {
  System.out.println(m.nextRecord().getName());
}

Expected result

a.sub.example.com.

Actual result

a.sub.

Version: 3.7.1 and current master (9e26eba).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions