[GH-ISSUE #251] Support user-specified location for /etc/hosts file #120

Open
opened 2026-03-07 22:21:04 +03:00 by kerem · 1 comment
Owner

Originally created by @briansmith on GitHub (Oct 24, 2017).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/251

Some uses of Trust-DNS, in particular some kinds of tests for applications that use Trust-DNS, would benefit from being able to specify the path of the /etc/hosts file. Perhaps instead of having a boolean flag indicating whether to use /etc/hosts, the setting could instead become a PathBuf that contains the path to the file?

Originally created by @briansmith on GitHub (Oct 24, 2017). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/251 Some uses of Trust-DNS, in particular some kinds of tests for applications that use Trust-DNS, would benefit from being able to specify the path of the /etc/hosts file. Perhaps instead of having a boolean flag indicating whether to use /etc/hosts, the setting could instead become a `PathBuf` that contains the path to the file?
Author
Owner

@briansmith commented on GitHub (Oct 24, 2017):

In particular, it seems like it would be useful to have this functionality for the purposes of testing the implementation of Hosts, especially on platforms that don't have /etc/hosts and/or where /etc/hosts is in a different place. For example, it would be great to be able to run all the tests for Hosts on Windows so that WIndows-based contributors can be more sure that they didn't break anything related to it before submitting a PR.

(As it is now, rustc emits a bunch of warnings when building this code for Windows because it is dead on Windows.)

<!-- gh-comment-id:338872317 --> @briansmith commented on GitHub (Oct 24, 2017): In particular, it seems like it would be useful to have this functionality for the purposes of testing the implementation of `Hosts`, especially on platforms that don't have `/etc/hosts` and/or where `/etc/hosts` is in a different place. For example, it would be great to be able to run all the tests for `Hosts` on Windows so that WIndows-based contributors can be more sure that they didn't break anything related to it before submitting a PR. (As it is now, rustc emits a bunch of warnings when building this code for Windows because it is dead on Windows.)
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#120
No description provided.