[GH-ISSUE #1734] disallowed_by_std3_ascii_rules problem #754

Closed
opened 2026-03-16 00:08:27 +03:00 by kerem · 4 comments
Owner

Originally created by @RickSKy on GitHub (Jul 8, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1734

Describe the bug

let mut response = resolver.ipv4_lookup("http://statototalitario.com/stub/index.php").await.unwrap();
    println!("{:#?}", response);

the program do not send the query packet, and return err like:

 thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ResolveError { kind: Proto(ProtoError { kind: Msg("Label contains invalid characters: Err(Errors { invalid_mapping, disallowed_by_std3_ascii_rules })") }) }'

but on any os platform, we use nslookup:

nslookup http://statototalitario.com/stub/index.php
Server:		127.0.0.53
Address:	127.0.0.53#53

** server can't find http://statototalitario.com/stub/index.php: NXDOMAIN

it send the query packet, and return NXDOMAIN.
why need this unnormal query? just for some security verify purpose .

Expected behavior
send the query packet,and return NXDOMAIN result

System:

  • OS: ALL OS

Version:
Crate: trust-dns-proto
Version: 0.21

Originally created by @RickSKy on GitHub (Jul 8, 2022). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1734 **Describe the bug** ```rust let mut response = resolver.ipv4_lookup("http://statototalitario.com/stub/index.php").await.unwrap(); println!("{:#?}", response); ``` the program do not send the query packet, and return err like: ```bash thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ResolveError { kind: Proto(ProtoError { kind: Msg("Label contains invalid characters: Err(Errors { invalid_mapping, disallowed_by_std3_ascii_rules })") }) }' ``` but on any os platform, we use nslookup: ```bash nslookup http://statototalitario.com/stub/index.php Server: 127.0.0.53 Address: 127.0.0.53#53 ** server can't find http://statototalitario.com/stub/index.php: NXDOMAIN ``` it send the query packet, and return NXDOMAIN. why need this unnormal query? just for some security verify purpose . **Expected behavior** send the query packet,and return NXDOMAIN result **System:** - OS: ALL OS **Version:** Crate: trust-dns-proto Version: 0.21
kerem closed this issue 2026-03-16 00:08:32 +03:00
Author
Owner

@bluejekyll commented on GitHub (Jul 11, 2022):

I'm not sure I understand what you're attempting to do here. The lookup methods expect a domain name as the input, not a full URL. For example instead of http://statototalitario.com/stub/index.php you'd want to pass in statototalitario.com.

To extract this information, you could use this method from the url crate to get the domain: https://docs.rs/url/2.2.2/url/struct.Url.html#method.domain

<!-- gh-comment-id:1180606787 --> @bluejekyll commented on GitHub (Jul 11, 2022): I'm not sure I understand what you're attempting to do here. The lookup methods expect a domain name as the input, not a full URL. For example instead of `http://statototalitario.com/stub/index.php` you'd want to pass in `statototalitario.com`. To extract this information, you could use this method from the `url` crate to get the domain: https://docs.rs/url/2.2.2/url/struct.Url.html#method.domain
Author
Owner

@RickSKy commented on GitHub (Jul 16, 2022):

wireshark or tcpdump capture the dns query packet, you will see below

Name: http://statototalitario.com/stub/index.php
 Name Length:42
 Label Count:3
Type: A (Host Address) (1)
 Class:IN (0x0001)

Maybe it should send the packet, and the dns server reply No Such Name like nslookup(on any os platform), not just errored when sending.

<!-- gh-comment-id:1186185435 --> @RickSKy commented on GitHub (Jul 16, 2022): wireshark or tcpdump capture the dns query packet, you will see below ``` Name: http://statototalitario.com/stub/index.php Name Length:42 Label Count:3 Type: A (Host Address) (1) Class:IN (0x0001) ``` Maybe it should send the packet, and the dns server reply No Such Name like nslookup(on any os platform), not just errored when sending.
Author
Owner

@bluejekyll commented on GitHub (Jul 16, 2022):

If you want to construct an invalid Name and send it, you can use the from labels methods https://docs.rs/trust-dns-proto/0.21.2/trust_dns_proto/rr/domain/struct.Name.html#method.from_labels and construct the labels using from raw bytes https://docs.rs/trust-dns-proto/0.21.2/trust_dns_proto/rr/domain/struct.Label.html#method.from_raw_bytes

<!-- gh-comment-id:1186213627 --> @bluejekyll commented on GitHub (Jul 16, 2022): If you want to construct an invalid Name and send it, you can use the from labels methods https://docs.rs/trust-dns-proto/0.21.2/trust_dns_proto/rr/domain/struct.Name.html#method.from_labels and construct the labels using from raw bytes https://docs.rs/trust-dns-proto/0.21.2/trust_dns_proto/rr/domain/struct.Label.html#method.from_raw_bytes
Author
Owner

@RickSKy commented on GitHub (Jul 17, 2022):

Thanks.

<!-- gh-comment-id:1186456062 --> @RickSKy commented on GitHub (Jul 17, 2022): Thanks.
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#754
No description provided.