Skip to content

Commit 9050d72

Browse files
committed
customizing "system" DNS server with config key "dns"
1 parent 12eadcd commit 9050d72

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,4 @@ daemonize = "0.4"
173173
byteorder = "1.3"
174174
env_logger = "0.9"
175175
byte_string = "1.0"
176-
tokio = { version = "1", features = ["net", "time", "macros", "io-util"]}
176+
tokio = { version = "1", features = ["net", "time", "macros", "io-util"] }

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ Example configuration:
590590
// Value could be IP address of DNS server, for example, "8.8.8.8".
591591
// DNS client will automatically request port 53 with both TCP and UDP protocol.
592592
//
593+
// - system, uses system provided API (`getaddrinfo` on *NIX)
594+
//
593595
// It also allows some pre-defined well-known public DNS servers:
594596
// - google (TCP, UDP)
595597
// - cloudflare (TCP, UDP)

crates/shadowsocks-service/src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,8 @@ impl Config {
17361736
/// 2. Pre-defined. Like `google`, `cloudflare`
17371737
pub fn set_dns_formatted(&mut self, dns: &str) -> Result<(), Error> {
17381738
self.dns = match dns {
1739+
"system" => DnsConfig::System,
1740+
17391741
#[cfg(feature = "trust-dns")]
17401742
"google" => DnsConfig::TrustDns(ResolverConfig::google()),
17411743

0 commit comments

Comments
 (0)