Skip to content

Zone files with multiple $ORIGINs produce incorrect labels #11

@SamLR

Description

@SamLR

Zone files with more than one $ORIGIN will produce incorrect (repeating) labels for records with later $ORIGINs that don't explicitly set their name to either '@' or some other name.

For example:

$ORIGIN example.com.
@   3600    SOA     ns1.example.com. (
                        hostmaster.example.com.
                        42
                        3600
                        600
                        86400
                        300
                        )

$ORIGIN sub.example.com.
@   3600    CNAME   sub2.example.com.
    3600    MX      10 mail.example.com.

will produce:

> zone = DNS::Zone::load(File.read('test.zone'))
> zone.records.each{ |r| puts r.label }
  @
  sub
  sub.sub

where the third label should be 'sub'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions