Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix $TTL not taken into account with wildcard from zonefile. #1850

Merged
merged 3 commits into from Dec 4, 2022

Conversation

darnuria
Copy link
Contributor

@darnuria darnuria commented Dec 4, 2022

Investigation arround #1849

I openned the PR to get feedback, it's not done yet. :)


Fixes: #1849

@darnuria
Copy link
Contributor Author

darnuria commented Dec 4, 2022

Added a dbg!(&record) to follow post-parsing Btree state:

[crates/server/src/store/file/authority.rs:202] &records = {
    RrKey {
        name: LowerName(
            Name("test.local."),
        ),
        record_type: SOA,
    }: RecordSet {
        name: Name("test.local."),
        record_type: SOA,
        dns_class: IN,
        ttl: 604800,
        records: [
            Record {
                name_labels: Name("test.local."),
                rr_type: SOA,
                dns_class: IN,
                ttl: 604800,
                rdata: Some(
                    SOA(
                        SOA {
                            mname: Name("ns.test.local."),
                            rname: Name("nobody.example.com."),
                            serial: 2022120201,
                            refresh: 3600,
                            retry: 1800,
                            expire: 604800,
                            minimum: 60,
                        },
                    ),
                ),
            },
        ],
        rrsigs: [],
        serial: 0,
    },
    RrKey {
        name: LowerName(
            Name("ns.test.local."),
        ),
        record_type: A,
    }: RecordSet {
        name: Name("ns.test.local."),
        record_type: A,
        dns_class: IN,
        ttl: 120,
        records: [
            Record {
                name_labels: Name("ns.test.local."),
                rr_type: A,
                dns_class: IN,
                ttl: 120,
                rdata: Some(
                    A(
                        127.0.0.1,
                    ),
                ),
            },
        ],
        rrsigs: [],
        serial: 0,
    },
    RrKey {
        name: LowerName(
            Name("simple.test.local."),
        ),
        record_type: A,
    }: RecordSet {
        name: Name("simple.test.local."),
        record_type: A,
        dns_class: IN,
        ttl: 120,
        records: [
            Record {
                name_labels: Name("simple.test.local."),
                rr_type: A,
                dns_class: IN,
                ttl: 120,
                rdata: Some(
                    A(
                        10.0.0.1,
                    ),
                ),
            },
        ],
        rrsigs: [],
        serial: 0,
    },
    RrKey {
        name: LowerName(
            Name("*.wc.test.local."),
        ),
        record_type: A,
    }: RecordSet {
        name: Name("*.wc.test.local."),
        record_type: A,
        dns_class: IN,
        ttl: 120,
        records: [
            Record {
                name_labels: Name("*.wc.test.local."),
                rr_type: A,
                dns_class: IN,
                ttl: 120,
                rdata: Some(
                    A(
                        10.0.0.2,
                    ),
                ),
            },
        ],
        rrsigs: [],
        serial: 0,
    },
}

@darnuria darnuria changed the title WIP: Fix $TTL not taken into account with wildcard from zonefile. Fix $TTL not taken into account with wildcard from zonefile. Dec 4, 2022
@darnuria darnuria force-pushed the fix/1849 branch 2 times, most recently from bf16497 to f62dcba Compare December 4, 2022 22:30
@darnuria darnuria force-pushed the fix/1849 branch 2 times, most recently from 2e7ebc8 to 8cbac0a Compare December 4, 2022 22:42
@bluejekyll bluejekyll merged commit 4e1dc5d into hickory-dns:main Dec 4, 2022
@bluejekyll
Copy link
Member

Thanks for the PR!

@darnuria darnuria deleted the fix/1849 branch December 5, 2022 00:08
@darnuria
Copy link
Contributor Author

darnuria commented Dec 5, 2022

Whops just noticed that a squash would have been cleaner for history. Later I will be more aware before saying "it's ready" x)

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.

Wildcard zone file entries always respond with a zero TTL
2 participants