Skip to content

Commit

Permalink
Rename template.servers to template.dns_servers
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Dec 31, 2024
1 parent 0130148 commit f635497
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs/configuration/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

"dns": "",
"dns_local": "",
"dns_servers": [],
"enable_fakeip": false,
"pre_dns_rules": [],
"custom_dns_rules": [],
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion option/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion template/render_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f635497

Please sign in to comment.