diff --git a/dns/router.go b/dns/router.go index 0d0c9519d..e8f1e0f42 100644 --- a/dns/router.go +++ b/dns/router.go @@ -410,6 +410,9 @@ func (r *Router) matchDNS(ctx context.Context, rules []adapter.DNSRule, allowFak } func (r *Router) applyDNSRouteOptions(options *adapter.DNSQueryOptions, routeOptions R.RuleActionDNSRouteOptions) { + // Strategy is intentionally skipped here. A non-default DNS rule action strategy + // forces legacy mode via resolveLegacyDNSMode, so this path is only reachable + // when strategy remains at its default value. if routeOptions.DisableCache { options.DisableCache = true } @@ -658,7 +661,7 @@ func (r *Router) lookupWithRulesType(ctx context.Context, rules []adapter.DNSRul RecursionDesired: true, }, Question: []mDNS.Question{{ - Name: mDNS.Fqdn(FqdnToDomain(domain)), + Name: mDNS.Fqdn(domain), Qtype: qType, Qclass: mDNS.ClassINET, }}, diff --git a/experimental/deprecated/constants.go b/experimental/deprecated/constants.go index 81ed14e04..c9f507387 100644 --- a/experimental/deprecated/constants.go +++ b/experimental/deprecated/constants.go @@ -98,6 +98,7 @@ var OptionIPAcceptAny = Note{ Description: "`ip_accept_any` in DNS rules", DeprecatedVersion: "1.14.0", ScheduledVersion: "1.16.0", + EnvName: "DNS_RULE_IP_ACCEPT_ANY", MigrationLink: "https://sing-box.sagernet.org/configuration/dns/rule/", } @@ -106,6 +107,7 @@ var OptionRuleSetIPCIDRAcceptEmpty = Note{ Description: "`rule_set_ip_cidr_accept_empty` in DNS rules", DeprecatedVersion: "1.14.0", ScheduledVersion: "1.16.0", + EnvName: "DNS_RULE_RULE_SET_IP_CIDR_ACCEPT_EMPTY", MigrationLink: "https://sing-box.sagernet.org/configuration/dns/rule/", } @@ -114,6 +116,7 @@ var OptionLegacyDNSAddressFilter = Note{ Description: "legacy address filter DNS rule items", DeprecatedVersion: "1.14.0", ScheduledVersion: "1.16.0", + EnvName: "LEGACY_DNS_ADDRESS_FILTER", MigrationLink: "https://sing-box.sagernet.org/configuration/dns/rule/", } @@ -122,6 +125,7 @@ var OptionLegacyDNSRuleStrategy = Note{ Description: "`strategy` in DNS rule actions", DeprecatedVersion: "1.14.0", ScheduledVersion: "1.16.0", + EnvName: "LEGACY_DNS_RULE_STRATEGY", MigrationLink: "https://sing-box.sagernet.org/configuration/dns/rule_action/", } diff --git a/route/rule/rule_item_response_rcode.go b/route/rule/rule_item_response_rcode.go index ae2c62248..e416c1d77 100644 --- a/route/rule/rule_item_response_rcode.go +++ b/route/rule/rule_item_response_rcode.go @@ -1,6 +1,7 @@ package rule import ( + "github.com/miekg/dns" "github.com/sagernet/sing-box/adapter" F "github.com/sagernet/sing/common/format" ) @@ -20,5 +21,5 @@ func (r *DNSResponseRCodeItem) Match(metadata *adapter.InboundContext) bool { } func (r *DNSResponseRCodeItem) String() string { - return F.ToString("response_rcode=", r.rcode) + return F.ToString("response_rcode=", dns.RcodeToString[r.rcode]) }