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

Default $TTL not working correctly on nsd >= 4.10.0 #375

Closed
dfxbb opened this issue Aug 16, 2024 · 3 comments
Closed

Default $TTL not working correctly on nsd >= 4.10.0 #375

dfxbb opened this issue Aug 16, 2024 · 3 comments
Assignees

Comments

@dfxbb
Copy link

dfxbb commented Aug 16, 2024

While parsing the zonefile, default $TTL is not used on all RRs with TTL omitted. Instead, it seems that the TTL of the previous record is used.

For example, with this zonefile:

$TTL 300
@               IN      SOA     dns.example.com. hostmaster.example.com. (11111 10800 3600 604800 3600)
@       86400   IN      NS      ns.example.com.
ns              IN      A       1.1.1.1
www             IN      A       2.2.2.2

On nsd <= 4.9.1, TTL of the last two A records (ns and www) is 300, as I am expecting.
output of nsd-checkzone -p example.com /root/example.zone:

$ORIGIN com.
example 300     IN      SOA     dns.example.com. hostmaster.example.com. (
                11111 10800 3600 604800 3600 )
        86400   IN      NS      ns.example.com.
$ORIGIN example.com.
ns      300     IN      A       1.1.1.1
www     300     IN      A       2.2.2.2
; zone example.com is ok

But on nsd >= 4.10.0 (test on 4.10.0 and 4.10.1), it became 86400.

$ORIGIN com.
example 300     IN      SOA     dns.example.com. hostmaster.example.com. (
                11111 10800 3600 604800 3600 )
        86400   IN      NS      ns.example.com.
$ORIGIN example.com.
ns      86400   IN      A       1.1.1.1
www     86400   IN      A       2.2.2.2
; zone example.com is ok
@k0ekk0ek k0ekk0ek self-assigned this Aug 16, 2024
@k0ekk0ek
Copy link

Thanks for reporting @dfxbb! I'll have a look.

k0ekk0ek added a commit to k0ekk0ek/simdzone that referenced this issue Aug 16, 2024
Use value specified in $TTL directive if available, otherwise use the
last stated explicit TTL. Signal whether the TTL is implicit or not via
a newly introduced flags parameter to allow for correcting TTL values
(or bailing) after deserialization of all RRs.

Fixes NLnetLabs/nsd#375.
k0ekk0ek added a commit to k0ekk0ek/simdzone that referenced this issue Aug 19, 2024
Use value specified in $TTL directive if available, use the last stated
explicit TTL otherwise.

Fixes NLnetLabs/nsd#375.
k0ekk0ek added a commit to k0ekk0ek/simdzone that referenced this issue Aug 19, 2024
Use value specified in $TTL directive if available, use the last stated
explicit TTL otherwise.

Fixes NLnetLabs/nsd#375.
@k0ekk0ek
Copy link

@dfxbb, NLnetLabs/simdzone#228 fixes this issue, so it's fixed in the next release. Thanks for reporting!

@dfxbb
Copy link
Author

dfxbb commented Aug 20, 2024

@k0ekk0ek Thanks for the timely fix! 👍

k0ekk0ek added a commit to k0ekk0ek/simdzone that referenced this issue Aug 23, 2024
Use value specified in $TTL directive if available, use the last stated
explicit TTL otherwise.

Fixes NLnetLabs/nsd#375.
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

No branches or pull requests

2 participants