Rename template.servers to template.dns_servers

This commit is contained in:
世界 2024-12-31 16:07:22 +08:00
parent 013014815f
commit f6354971c4
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
3 changed files with 9 additions and 2 deletions

View File

@ -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.

View File

@ -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"`

View File

@ -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,