[GH-ISSUE #2251] provide support for dns resolution for files located in etc/resolver on macOS #936

Open
opened 2026-03-16 01:01:29 +03:00 by kerem · 5 comments
Owner

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:

  • each file should be named after the domain it is configuring.
  • each resolver file should contain configuration lines for a specific domain.
  • the search directive specifies the default domain suffix to append to unqualified names.
  • the nameserver directive specifies the IP address of the DNS server for the domain.
  • the port directive is optional and specifies a non-standard port for DNS queries (default is port 53).

Describe the solution you'd like
could you provide support for dns resolution for files located in etc/resolver on macOS

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: - each file should be named after the domain it is configuring. - each resolver file should contain configuration lines for a specific domain. - the search directive specifies the default domain suffix to append to unqualified names. - the nameserver directive specifies the IP address of the DNS server for the domain. - the port directive is optional and specifies a non-standard port for DNS queries (default is port 53). **Describe the solution you'd like** could you provide support for dns resolution for files located in etc/resolver on macOS
Author
Owner

@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.conf but it has this comment:

# macOS Notice
#
# This file is not consulted for DNS hostname resolution, address
# resolution, or the DNS query routing mechanism used by most
# processes on this system.
#
# To view the DNS configuration used by this system, use:
#   scutil --dns
#
# SEE ALSO
#   dns-sd(1), scutil(8)
#
# This file is automatically generated.

Perhaps you can more directly/explicitly describe the behavior you're looking for, without assuming familiarity with CoreDNS or k8s DNS.

<!-- gh-comment-id:2182379876 --> @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.conf` but it has this comment: ``` # macOS Notice # # This file is not consulted for DNS hostname resolution, address # resolution, or the DNS query routing mechanism used by most # processes on this system. # # To view the DNS configuration used by this system, use: # scutil --dns # # SEE ALSO # dns-sd(1), scutil(8) # # This file is automatically generated. ``` Perhaps you can more directly/explicitly describe the behavior you're looking for, without assuming familiarity with CoreDNS or k8s DNS.
Author
Owner

@Druecke04 commented on GitHub (Jun 24, 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.conf but it has this comment:

# macOS Notice
#
# This file is not consulted for DNS hostname resolution, address
# resolution, or the DNS query routing mechanism used by most
# processes on this system.
#
# To view the DNS configuration used by this system, use:
#   scutil --dns
#
# SEE ALSO
#   dns-sd(1), scutil(8)
#
# This file is automatically generated.

Perhaps you can more directly/explicitly describe the behavior you're looking for, without assuming familiarity with CoreDNS or k8s DNS.

Good call outs - The description of the ask and desired behavior has been updated.

<!-- gh-comment-id:2187079247 --> @Druecke04 commented on GitHub (Jun 24, 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.conf` but it has this comment: > > ``` > # macOS Notice > # > # This file is not consulted for DNS hostname resolution, address > # resolution, or the DNS query routing mechanism used by most > # processes on this system. > # > # To view the DNS configuration used by this system, use: > # scutil --dns > # > # SEE ALSO > # dns-sd(1), scutil(8) > # > # This file is automatically generated. > ``` > > Perhaps you can more directly/explicitly describe the behavior you're looking for, without assuming familiarity with CoreDNS or k8s DNS. Good call outs - The description of the ask and desired behavior has been updated.
Author
Owner

@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 ResolverConfig to something else and add a new type somewhat like struct ResolveContext { default: ResolverConfig, networks: HashMap<Name, ResolverConfig> }, and then add some abstractions to change how the resolver interacts with ResolveContext. I suggest you look at the code in crates/resolver/src/config.rs.

<!-- gh-comment-id:2188246992 --> @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 `ResolverConfig` to something else and add a new type somewhat like `struct ResolveContext { default: ResolverConfig, networks: HashMap<Name, ResolverConfig> }`, and then add some abstractions to change how the resolver interacts with `ResolveContext`. I suggest you look at the code in `crates/resolver/src/config.rs`.
Author
Owner

@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.

<!-- gh-comment-id:3395538386 --> @Wyctus commented on GitHub (Oct 13, 2025): I just also faced this today, as Prisma's Rust MongoDB [driver](https://github.com/prisma/mongo-rust-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.
Author
Owner

@djc commented on GitHub (Oct 13, 2025):

I'm open to working on this if someone wants to sponsor the work.

<!-- gh-comment-id:3396457546 --> @djc commented on GitHub (Oct 13, 2025): I'm open to working on this if someone wants to sponsor the work.
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#936
No description provided.