[PR #1740] [MERGED] Do not fail parse_resolv_conf on invalid hostname #2559

Closed
opened 2026-03-16 10:11:41 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1740
Author: @schultetwin1
Created: 7/13/2022
Status: Merged
Merged: 7/29/2022
Merged by: @djc

Base: mainHead: no_parse_error_for_invalid_hostnames


📝 Commits (2)

  • ce230c4 Do not fail parse_resolv_conf on invalid hostname
  • ec719a6 Add comments explaining design decision

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 crates/resolver/src/system_conf/unix.rs (+5 -1)

📄 Description

On macOS, user's can set their hostname to something invalid such as
matt.schulte's macbookpro. This will cause parse_resolv_conf to fail
because "into_resolver_config" will think the hostname contains the
system domain and then fail to parse that system domain.

Instead, we should treat the hostname as if it contains no domain (the
same as if the hostname contained no ".").

This fixes #1739


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/1740 **Author:** [@schultetwin1](https://github.com/schultetwin1) **Created:** 7/13/2022 **Status:** ✅ Merged **Merged:** 7/29/2022 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `no_parse_error_for_invalid_hostnames` --- ### 📝 Commits (2) - [`ce230c4`](https://github.com/hickory-dns/hickory-dns/commit/ce230c4539e92946f7439ef8d197a2dc215ce60d) Do not fail parse_resolv_conf on invalid hostname - [`ec719a6`](https://github.com/hickory-dns/hickory-dns/commit/ec719a65ae6ef521db0686b0828873b88f5e8572) Add comments explaining design decision ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/resolver/src/system_conf/unix.rs` (+5 -1) </details> ### 📄 Description On macOS, user's can set their hostname to something invalid such as matt.schulte's macbookpro. This will cause parse_resolv_conf to fail because "into_resolver_config" will think the hostname contains the system domain and then fail to parse that system domain. Instead, we should treat the hostname as if it contains no domain (the same as if the hostname contained no "."). This fixes #1739 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 10:11:41 +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#2559
No description provided.