[GH-ISSUE #2098] Incorrect interaction between Config.toml and SOA record #886

Open
opened 2026-03-16 00:45:07 +03:00 by kerem · 1 comment
Owner

Originally created by @SivaKesava1 on GitHub (Nov 30, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2098

Describe the bug
If a user, by mistake, uploads a zone file which has no FQDN, then there is some strange interaction between the Config.toml file and the SOA record. This may not be very realistic but recording the behavior of TrustDNS.

To Reproduce
Consider the following simple zone file:

test 500 SOA ns1.outside.com. root.test 3 604800 86400 2419200 604800
test 500 NS ns1.outside.com.
foo 500 A 1.1.1.1

with config.toml as:

[[zones]]
zone = "test"
zone_type = "Primary"

Please note that there are no . in the zone file or in the Config file.

TrustDNS considers the zone as that of test from the Config and all the records names are relative names.

Expected behavior
If you query for the SOA record either using test.test. or test. then we do not get the SOA record, but the RCODE is NOERROR. However, if I query <test.test., NS>, I get the NS record and similarly the IP record with <foo.test.>. I have tried to obtain the SOA record, but I could not find. This is strange because there is a zone called test. that should have the SOA record. A possible solution is to raise an error and not load the zone file when the zone file is like this.

System:
OS: Ubuntu
Architecture: x86_64
Version: 18
rustc version: cargo 1.47.0

Version:
Crate: server
Version: :Trust-DNS 0.23.1

Originally created by @SivaKesava1 on GitHub (Nov 30, 2023). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2098 **Describe the bug** If a user, by mistake, uploads a zone file which has no FQDN, then there is some strange interaction between the Config.toml file and the SOA record. This may not be very realistic but recording the behavior of TrustDNS. **To Reproduce** Consider the following simple zone file: | | | | | |- |- |- |- | | test | 500 | SOA | ns1.outside.com. root.test 3 604800 86400 2419200 604800 | | test | 500 | NS | ns1.outside.com. | | foo | 500 | A | 1.1.1.1 | with config.toml as: ``` [[zones]] zone = "test" zone_type = "Primary" ``` Please note that there are no `.` in the zone file or in the Config file. TrustDNS considers the zone as that of `test` from the Config and all the records names are relative names. **Expected behavior** If you query for the `SOA` record either using `test.test.` or `test.` then we do not get the `SOA` record, but the RCODE is `NOERROR`. However, if I query `<test.test., NS>`, I get the `NS` record and similarly the IP record with `<foo.test.>`. I have tried to obtain the SOA record, but I could not find. This is strange because there is a zone called `test.` that should have the SOA record. A possible solution is to raise an error and not load the zone file when the zone file is like this. **System:** OS: Ubuntu Architecture: x86_64 Version: 18 rustc version: cargo 1.47.0 **Version:** Crate: server Version: :Trust-DNS 0.23.1
Author
Owner

@djc commented on GitHub (Dec 1, 2023):

Have you tried the hickory-dns 0.24 release? IIRC it has some changes to zone file parsing that might affect stuff like this.

<!-- gh-comment-id:1835735597 --> @djc commented on GitHub (Dec 1, 2023): Have you tried the hickory-dns 0.24 release? IIRC it has some changes to zone file parsing that might affect stuff like this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#886
No description provided.