mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #2251] provide support for dns resolution for files located in etc/resolver on macOS #936
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#936
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Druecke04 on GitHub (Jun 20, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2251
Is your feature request related to a problem? Please describe.
We are using CoreDNS locally to forward to k8s DNS in a remote cluster - which currently does not work with macOS dns resolution.
Macs support the use of /etc/resolver files. These files can be used to specify custom DNS settings for specific domains or hosts on a macOS system.
Each file in /etc/resolver/ is named after a domain (e.g., internal.example.com) and contains directives specifying which DNS server(s) to use and other DNS resolution options for that domain, and allowing the override of global DNS settings configured in /etc/resolv.conf for those specific domains.
This is in comparison to the /etc/resolv.conf file which is used to configure global DNS settings for the entire system on macOS - the key difference in the finer granularity and control over DNS settings.
With the resolver files in place, macOS will use the custom dns settings specified in the resolve file(s) to resolve domain names. Without the existence of these resolve file(s) all routing will be forwarded to /etc/resolve.conf for resolution.
example resolver file:
cat /etc/resolver/internal.example.com
search internal.example.com
nameserver 10.99.99.1
port 5300
additional notes resolver files:
Describe the solution you'd like
could you provide support for dns resolution for files located in etc/resolver on macOS
@djc commented on GitHub (Jun 21, 2024):
hickory-dns is currently mostly getting passive maintenance. I'd be happy to review a PR in this direction but am unlikely to be able to work on it myself.
BTW, the feature request itself is not very clear to me. On my macOS system, for one thing, there is no
/etc/resolver. There is an/etc/resolv.confbut it has this comment:Perhaps you can more directly/explicitly describe the behavior you're looking for, without assuming familiarity with CoreDNS or k8s DNS.
@Druecke04 commented on GitHub (Jun 24, 2024):
Good call outs - The description of the ask and desired behavior has been updated.
@djc commented on GitHub (Jun 25, 2024):
Right. Since this is fairly niche, I think it's unlikely that this will get worked on unless you/your team do it yourself (or pay someone for it -- unfortunately I'm currently unable to take on contracting work).
Unfortunately the core data structures aren't currently really set up for this. I'm guessing you'll want to rename the current
ResolverConfigto something else and add a new type somewhat likestruct ResolveContext { default: ResolverConfig, networks: HashMap<Name, ResolverConfig> }, and then add some abstractions to change how the resolver interacts withResolveContext. I suggest you look at the code incrates/resolver/src/config.rs.@Wyctus commented on GitHub (Oct 13, 2025):
I just also faced this today, as Prisma's Rust MongoDB driver uses Hickory DNS, hence Prisma ignores the domain-specific resolver settings configured via
/etc/resolver/....No pressure or anything, I saw that this would require a lot of modification, just mentioning it, that it has not only a k8s effect.
@djc commented on GitHub (Oct 13, 2025):
I'm open to working on this if someone wants to sponsor the work.