[GH-ISSUE #1739] parse_resolv_conf fails if machine's hostname contains a "." followed by a non alphanumeric value #755

Closed
opened 2026-03-16 00:09:09 +03:00 by kerem · 0 comments
Owner

Originally created by @schultetwin1 on GitHub (Jul 13, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1739

Describe the bug
In parse_resolv_conf, into_resolver_config attempts to use the device's hostname as the "domain" filed for ResolverConfig. If the device's hostname has a "." but is not a valid domain, it will cause parse_resolv_conf to fail.

To Reproduce

  1. Set your machine's hostname to "matt.schulte's macbook pro"
  2. Call parse_resolve_conf

Expected behavior
As long as your resolv.conf is valid, I would expect the parse_resolv_conf to succeed. But it fails.

System:

  • OS: Repro'd on macOS. Probably affects all unix machines
  • Architecture: x86_64. Probably affects all
  • Version 12.4
  • rustc version: 1.62

Version:
Crate: resolver
Version: 0.21.2

Originally created by @schultetwin1 on GitHub (Jul 13, 2022). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1739 **Describe the bug** In `parse_resolv_conf`, `into_resolver_config` attempts to use the device's hostname as the "domain" filed for ResolverConfig. If the device's hostname has a "." but is not a valid domain, it will cause parse_resolv_conf to fail. **To Reproduce** 1. Set your machine's hostname to "matt.schulte's macbook pro" 2. Call parse_resolve_conf **Expected behavior** As long as your resolv.conf is valid, I would expect the parse_resolv_conf to succeed. But it fails. **System:** - OS: Repro'd on macOS. Probably affects all unix machines - Architecture: x86_64. Probably affects all - Version 12.4 - rustc version: 1.62 **Version:** Crate: resolver Version: 0.21.2
kerem closed this issue 2026-03-16 00:09:14 +03:00
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#755
No description provided.