feat: add DNS override settings (listen, fake-ip-range)#187
Open
zhkong wants to merge 3 commits into
Open
Conversation
e0cc3c7 to
c54154d
Compare
Add TUN mode settings to mihomo config override system, allowing users to enable TUN via [mihomo_config.tun] in mihoro.toml with options for stack, auto-route, auto-detect-interface, and dns-hijack.
Owner
|
Thank you for your contributions, but I'm afraid I need some more time to consider how complicated fields like dns are managed in mihoro. |
spencerwooo
requested changes
Apr 18, 2026
Owner
spencerwooo
left a comment
There was a problem hiding this comment.
I would prefer if we just scope this PR to managing dns for now. TUN support is blocked on letting mihoro run as root first, so I don’t think we should land that here yet.
The dns section in mihomo is large and fairly interdependent, and we don't have the bandwidth to support partial config merging grammar in mihoro.
If we support DNS overrides in mihoro, I’d prefer mihoro to own the entire dns block when [mihomo_config.dns] is present, and otherwise leave the remote dns block untouched.
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
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.
Summary
Add DNS configuration override support to mihoro, allowing users to control mihomo's DNS settings from
mihoro.toml.New fields added under
[mihomo_config.dns]:enable— enable/disable DNS (default:true)listen— DNS listen address (default:0.0.0.0:5353)fake_ip_range— fake IP CIDR range (default:198.18.0.1/16)Referenced from https://wiki.metacubex.one/config/dns
Changes
MihomoDnsConfigstruct for TOML config with serde defaultsdnsfield to bothMihomoConfigandMihomoYamlConfigapply_mihomo_override()to merge DNS overrides while keeping remote DNS fields intactExample config
[mihomo_config.dns]
enable = true
listen = "0.0.0.0:5353"
fake_ip_range = "198.18.0.1/16"