Bugfix: add ipv6 parsing for custom DNS server
@@ -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{
