Fix #18, support custom

upstream dns port
This commit is contained in:
wweir
2019-09-28 13:15:47 +08:00
parent 2fe1708d3f
commit 697e2aa1d5
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ password="12345678"
server_port="5533"
# server_addr="remote-server" # replce it to remote server
http_proxy=":8080" # eg: 192.168.0.2:8080
dns_server="" # Keep empty for dynamic setting from net env
dns_server="" # eg: 113.5.5.5:53, Keep empty for dynamic setting from net env
client_ip="127.0.0.1" # listen the IP, dns target is the IP
# clear_dns_cache="pkill mDNSResponder || true" # Windows: "ipconfig /flushdnss"
suggest_level="SPEEDUP" # DISABLE, BLOCK, SPEEDUP
+3 -1
View File
@@ -23,7 +23,9 @@ func StartDNS(dnsServer, listenIP string, suggestCh chan<- string, level string)
dhcpCh := make(chan struct{})
if dnsServer != "" {
dnsServer = net.JoinHostPort(dnsServer, "53")
if !strings.ContainsRune(dnsServer, ':') {
dnsServer = net.JoinHostPort(dnsServer, "53")
}
} else {
go dynamicSetUpstreamDNS(listenIP, &dnsServer, dhcpCh)
dhcpCh <- struct{}{}