Skip to content

Conversation

@myleshorton
Copy link
Contributor

This pull request updates the singbox.json configuration to improve DNS handling and routing logic. The main changes focus on refining DNS behavior, adding new outbound options, and enhancing routing rules to prevent conflicts and ensure correct traffic flow.

DNS configuration improvements:

  • Set "rewrite_ttl": 1 for the DNS server entry to control DNS cache duration and switched the "final" DNS policy from dns_remote to dns_local for more predictable local DNS resolution.

Outbound and routing enhancements:

  • Added a new outbound entry of type "dns" with tag "dns-out" to support DNS-specific outbound routing.
  • Introduced an exclusion rule in the routing section to ensure that traffic in "Direct" clash mode is always sent via the "direct" outbound, preventing sing-box components from being hijacked again.

Copilot AI review requested due to automatic review settings December 31, 2025 18:38
@myleshorton myleshorton merged commit 96eb9ee into main Dec 31, 2025
6 checks passed
@myleshorton myleshorton deleted the myleshorton-patch-1 branch December 31, 2025 18:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enhances the sing-box DNS and routing configuration by adding TTL control for FakeIP DNS, switching the fallback DNS server, and introducing DNS-specific outbound routing with clash mode exclusion rules.

  • Added rewrite_ttl: 1 to the FakeIP DNS rule to control DNS cache duration
  • Switched the final DNS server from dns_remote to dns_local for more predictable local resolution
  • Added a new DNS outbound (dns-out) and a routing exclusion rule to prevent sing-box components from being hijacked when in Direct clash mode

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

},
// 2. EXCLUSION: Prevent sing-box components from being hijacked again
{
"clash_mode": "Direct",
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clash_mode value "Direct" uses a capital 'D', but other examples in the codebase (such as vpn/testdata/boxopts.json) use lowercase values like "direct". Verify that clash_mode values are case-sensitive and ensure consistency with the actual clash mode names used in the configuration. According to sing-box conventions, clash modes are typically lowercase.

Suggested change
"clash_mode": "Direct",
"clash_mode": "direct",

Copilot uses AI. Check for mistakes.
"port": 53,
"action": "hijack-dns"
},
// 2. EXCLUSION: Prevent sing-box components from being hijacked again
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment numbering "2. EXCLUSION" suggests there should be a "1." comment somewhere for the first rule. However, the first rule group (sniff and hijack-dns actions) is not labeled as "1." which creates an inconsistency in the documentation. Consider either removing the "2." prefix or adding a "1." comment before the first rule group to maintain consistent numbering.

Suggested change
// 2. EXCLUSION: Prevent sing-box components from being hijacked again
// EXCLUSION: Prevent sing-box components from being hijacked again

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants