From f6354971c4d4fb392ea03e00765144de4c80eadd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 31 Dec 2024 16:07:22 +0800 Subject: [PATCH] Rename `template.servers` to `template.dns_servers` --- docs/configuration/template.md | 7 +++++++ option/template.go | 2 +- template/render_dns.go | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/configuration/template.md b/docs/configuration/template.md index d4a5e34..04f0b09 100644 --- a/docs/configuration/template.md +++ b/docs/configuration/template.md @@ -19,6 +19,7 @@ "dns": "", "dns_local": "", + "dns_servers": [], "enable_fakeip": false, "pre_dns_rules": [], "custom_dns_rules": [], @@ -143,6 +144,12 @@ DNS server used for China DNS requests. `114.114.114.114` is used by default. +#### dns_servers + +List of [DNS Server](https://sing-box.sagernet.org/configuration/dns/server/). + +Will be append to DNS servers. + #### enable_fakeip Enable FakeIP. diff --git a/option/template.go b/option/template.go index 59201cc..0f93caf 100644 --- a/option/template.go +++ b/option/template.go @@ -28,7 +28,7 @@ type _Template struct { RemoteResolve bool `json:"remote_resolve,omitempty"` // DNS - Servers []option.DNSServerOptions `json:"servers,omitempty"` + DNSServers []option.DNSServerOptions `json:"dns_servers,omitempty"` DNS string `json:"dns,omitempty"` DNSLocal string `json:"dns_local,omitempty"` EnableFakeIP bool `json:"enable_fakeip,omitempty"` diff --git a/template/render_dns.go b/template/render_dns.go index 2326980..36f9186 100644 --- a/template/render_dns.go +++ b/template/render_dns.go @@ -109,7 +109,7 @@ func (t *Template) renderDNS(metadata M.Metadata, options *option.Options) error Address: "fakeip", }) } - options.DNS.Servers = append(options.DNS.Servers, t.Servers...) + options.DNS.Servers = append(options.DNS.Servers, t.DNSServers...) options.DNS.Rules = []option.DNSRule{ { Type: C.RuleTypeDefault,