-
-
Notifications
You must be signed in to change notification settings - Fork 131
feat: add macOS SystemConfiguration DNS support and internal strategy #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Owner
|
Looks good! I'll do some more testing on my end and will have this merged. Thanks for the PR :) |
mr-karan
requested changes
Dec 17, 2025
Owner
mr-karan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Minor changes.
- Remove unused fields from scutilResolver struct - Remove unused stderr buffer - Remove redundant filtering in internal strategy - Return error when --strategy=internal finds no private IP nameservers
Contributor
Author
|
I believe I have addressed the feedback. Thanks for the review! Looking forward to merging this. :) |
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Dec 23, 2025
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [mr-karan/doggo](https://github.com/mr-karan/doggo) | patch | `v1.1.2` → `v1.1.3` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>mr-karan/doggo (mr-karan/doggo)</summary> ### [`v1.1.3`](https://github.com/mr-karan/doggo/releases/tag/v1.1.3) [Compare Source](mr-karan/doggo@v1.1.2...v1.1.3) #### Changelog ##### New Features - [`23fdfe1`](mr-karan/doggo@23fdfe1): feat(web): add SEO meta tags and FAQ page ([@​mr-karan](https://github.com/mr-karan)) - [`39bae49`](mr-karan/doggo@39bae49): feat: add macOS SystemConfiguration DNS support and internal strategy ([#​193](mr-karan/doggo#193)) ([@​phrawzty](https://github.com/phrawzty)) ##### Bug fixes - [`15d6c34`](mr-karan/doggo@15d6c34): fix: restore table text wrapping and respect -4/-6 flags for query types ([@​mr-karan](https://github.com/mr-karan)) ##### Others - [`46a1de3`](mr-karan/doggo@46a1de3): chore: upgrade go dependencies ([@​mr-karan](https://github.com/mr-karan)) - [`47136e4`](mr-karan/doggo@47136e4): docs(README): add mise alternative method installation ([@​jylenhof](https://github.com/jylenhof)) - [`d1091e3`](mr-karan/doggo@d1091e3): refactor: address MR [#​227](mr-karan/doggo#227) review feedback ([@​phrawzty](https://github.com/phrawzty)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi42NC4xIiwidXBkYXRlZEluVmVyIjoiNDIuNjQuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I figured I'd take a crack at #193 since I had the same observation.
Currently, doggo reads DNS configuration from
/etc/resolv.confon macOS, but this file doesn't reflect the actual DNS settings managed by the SystemConfiguration framework. Modern macOS systems usescutil --dnsto expose the real configuration, which can include multiple resolvers for different domains - particularly important when connected to corporate VPNs or using MDM profiles.I've added a new
config_darwin.gothat parses the output ofscutil --dnsinstead. This gives doggo access to all the DNS servers configured on the system, including domain-specific resolvers that are common in enterprise environments. The implementation gracefully falls back to reading/etc/resolv.confif scutil isn't available or fails for any reason.While working on this, I realized it would be helpful to have a way to specifically query internal/corporate DNS servers. So I've also added a new
--strategy=internaloption that automatically filters for RFC 1918 private IP addresses (10.x.x.x,172.16-31.x.x,192.168.x.x) and RFC 4193 IPv6 ULA addresses (fd00::/8). This makes it much easier to investigate name resolution issues when you're connected to a VPN or have corporate DNS profiles installed.The macOS-specific code lives in
config_darwin.goand follows the same pattern as the existing Windows implementation. I updated the Unix config build tag to exclude darwin, so Linux and BSD systems continue using the existing/etc/resolv.confapproach. The internal strategy logic integrates cleanly with the existing strategy system and respects the IPv4/IPv6 filtering flags.One thing worth noting: the implementation aggregates nameservers from all non-mDNS resolvers, not just resolver
#1. This means the--strategy=internaloption can discover corporate DNS servers even when they're configured as domain-specific resolvers (e.g. resolver#8for*.corp.example.com).This is a purely additive change. The existing strategies (
all,random,first) work exactly as before, and explicit nameserver specifications with-ncontinue to work. The default behavior on macOS now uses scutil instead of/etc/resolv.conf, but returns the same nameservers in practice (resolver#1). Other platforms are completely unaffected.I've tested this with various network configurations on macOS: standard public DNS, connected to a corporate VPN with internal DNS servers, and with domain-specific resolver profiles. The internal strategy correctly identifies and uses private IP nameservers, and successfully resolves internal corporate domains. The fallback to
/etc/resolv.confworks as expected when scutil isn't available.