[GH-ISSUE #1899] How to clear default domain in ResolverConfig #811

Closed
opened 2026-03-16 00:20:04 +03:00 by kerem · 1 comment
Owner

Originally created by @scw00 on GitHub (Feb 28, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1899

Describe the bug
ResovlerConfig.domain is always set from system_conf and cant be cleared.

To Reproduce
Steps to reproduce the behavior:

trust_dns_resolver::system_conf::read_system_conf().unwrap()

Expected behavior
Do not append machine name to the searching name.

System:

  • OS: [macOS]
  • Architecture: [x86_64]
  • Version [*]
  • rustc version: [newest]

Version:
Crate: [x]
Version: [x]

Additional context
Add any other context about the problem here.

Originally created by @scw00 on GitHub (Feb 28, 2023). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1899 **Describe the bug** `ResovlerConfig.domain` is always set from system_conf and cant be cleared. **To Reproduce** Steps to reproduce the behavior: ``` trust_dns_resolver::system_conf::read_system_conf().unwrap() ``` **Expected behavior** Do not append machine name to the searching name. **System:** - OS: [macOS] - Architecture: [x86_64] - Version [*] - rustc version: [newest] **Version:** Crate: [x] Version: [x] **Additional context** Add any other context about the problem here.
kerem 2026-03-16 00:20:04 +03:00
Author
Owner

@bluejekyll commented on GitHub (Mar 31, 2023):

This should be possible by not specifying this in the search paths, and the base domain:

https://docs.rs/trust-dns-resolver/0.22.0/trust_dns_resolver/config/struct.ResolverConfig.html#method.set_domain

or search paths:

https://docs.rs/trust-dns-resolver/0.22.0/trust_dns_resolver/config/struct.ResolverConfig.html#method.add_search

It looks like we don't expose a way to clear those settings, but you could set a domain of . that would effectively do that (I think).

<!-- gh-comment-id:1492207409 --> @bluejekyll commented on GitHub (Mar 31, 2023): This should be possible by not specifying this in the search paths, and the base domain: https://docs.rs/trust-dns-resolver/0.22.0/trust_dns_resolver/config/struct.ResolverConfig.html#method.set_domain or search paths: https://docs.rs/trust-dns-resolver/0.22.0/trust_dns_resolver/config/struct.ResolverConfig.html#method.add_search It looks like we don't expose a way to clear those settings, but you could set a domain of `.` that would effectively do that (I think).
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#811
No description provided.