[GH-ISSUE #1725] <&str as IntoName>::into_name("1.2.3.4") returns Ok(_) #749

Open
opened 2026-03-16 00:07:56 +03:00 by kerem · 3 comments
Owner

Originally created by @tamird on GitHub (Jun 15, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1725

Per RFC 1123 section 2.1:

If a dotted-decimal number can be entered without such
identifying delimiters, then a full syntactic check must be
made, because a segment of a host domain name is now allowed
to begin with a digit and could legally be entirely numeric
(see Section 6.1.2.4). However, a valid host name can never
have the dotted-decimal form #.#.#.#, since at least the
highest-level component label will be alphabetic.

The current implementation does not reject this.

Originally created by @tamird on GitHub (Jun 15, 2022). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1725 Per [RFC 1123 section 2.1](https://www.rfc-editor.org/rfc/rfc1123#section-2): > If a dotted-decimal number can be entered without such identifying delimiters, then a full syntactic check must be made, because a segment of a host domain name is now allowed to begin with a digit and could legally be entirely numeric (see [Section 6.1.2.4](https://www.rfc-editor.org/rfc/rfc1123#section-6.1.2.4)). However, a valid host name can never have the dotted-decimal form #.#.#.#, since at least the highest-level component label will be alphabetic. The current implementation does not reject this.
Author
Owner

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

I suppose we can add a check for this. I don't have any issue with that. It would need to come on the next release boundary though.

<!-- gh-comment-id:1180865741 --> @bluejekyll commented on GitHub (Jul 11, 2022): I suppose we can add a check for this. I don't have any issue with that. It would need to come on the next release boundary though.
Author
Owner

@darnuria commented on GitHub (Aug 5, 2022):

Quite a good sum up of the actual "state of the art" https://stackoverflow.com/questions/9071279/number-in-the-top-level-domain
Some possible possibilities: (not a maintainer nor contributor to trustdns just making suggestions)

  • Have a list of "now valid TLD to check against" like Firefox/chromium (don't know it's still the case)
  • Try to find the good parsing of the last label in case of FQDN.
  • Or having something like a fn is_rfc1123_hostname() regex/parser based solution to check if needed if a Name is valid like in PowerDNS.
<!-- gh-comment-id:1206857288 --> @darnuria commented on GitHub (Aug 5, 2022): Quite a good sum up of the actual "state of the art" https://stackoverflow.com/questions/9071279/number-in-the-top-level-domain Some possible possibilities: (not a maintainer nor contributor to trustdns just making suggestions) - Have a list of "now valid TLD to check against" like Firefox/chromium (don't know it's still the case) - Try to find the good parsing of the last label in case of FQDN. - Or having something like a `fn is_rfc1123_hostname()` regex/parser based solution to check if needed if a `Name` is valid like in PowerDNS.
Author
Owner

@bluejekyll commented on GitHub (Aug 5, 2022):

That’s a really helpful link. Thanks for sharing.

<!-- gh-comment-id:1206866334 --> @bluejekyll commented on GitHub (Aug 5, 2022): That’s a really helpful link. Thanks for sharing.
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#749
No description provided.