From 03e905e79d7fff196115f0c0f789e8e69e3abb80 Mon Sep 17 00:00:00 2001 From: 233boy <31657650+233boy@users.noreply.github.com> Date: Mon, 2 Mar 2026 10:37:38 +0800 Subject: [PATCH] fix sb dns --- sing-box.sh | 2 +- src/dns.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sing-box.sh b/sing-box.sh index e67f46a..33953fd 100644 --- a/sing-box.sh +++ b/sing-box.sh @@ -1,6 +1,6 @@ #!/bin/bash args=$@ -is_sh_ver=v1.14 +is_sh_ver=v1.15 . /etc/sing-box/sh/src/init.sh \ No newline at end of file diff --git a/src/dns.sh b/src/dns.sh index 118ed49..e4fd0a0 100644 --- a/src/dns.sh +++ b/src/dns.sh @@ -51,11 +51,11 @@ dns_set() { fi is_dns_use_bak=$is_dns_use if [[ $is_dns_use == "none" ]]; then - cat <<<$(jq '.dns={}' $is_config_json) >$is_config_json + cat <<<$(jq '.|.dns={}|del(.route.default_domain_resolver)' $is_config_json) >$is_config_json else if [[ $is_dns_new ]]; then dns_set_server $is_dns_use - cat <<<$(jq '.dns.servers=[{type:"'$is_dns_type'",server:"'$is_dns_use'",domain_resolver:"local"},{tag:"local",type:"local"}]' $is_config_json) >$is_config_json + cat <<<$(jq '.|.dns.servers=[{tag:"dns",type:"'$is_dns_type'",server:"'$is_dns_use'",domain_resolver:"local"},{tag:"local",type:"local"}]|.route.default_domain_resolver="dns"' $is_config_json) >$is_config_json else cat <<<$(jq '.dns.servers=[{address:"'$is_dns_use'",address_resolver:"local"},{tag:"local",address:"local"}]' $is_config_json) >$is_config_json fi