Bugfix: add ipv6 parsing for custom DNS server (#3266)

pull/3282/head
Gerhard Tan 2 years ago committed by GitHub
parent 0eecab06c1
commit d205c26480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -114,8 +114,8 @@ func (svr *Service) Run() error {
// set custom DNSServer
if svr.cfg.DNSServer != "" {
dnsAddr := svr.cfg.DNSServer
if !strings.Contains(dnsAddr, ":") {
dnsAddr += ":53"
if _, _, err := net.SplitHostPort(dnsAddr); err != nil {
dnsAddr = net.JoinHostPort(dnsAddr, "53")
}
// Change default dns server for frpc
net.DefaultResolver = &net.Resolver{

Loading…
Cancel
Save