Skip to content

Commit

Permalink
feat: support for custom dns port (#942)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeessy2 committed Dec 19, 2023
1 parent ebf78ee commit a36c4c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os/exec"
"path/filepath"
"strconv"
"strings"
"time"

"github.com/jeessy2/ddns-go/v5/config"
Expand Down Expand Up @@ -83,7 +84,11 @@ func main() {
util.SetInsecureSkipVerify()
}
if *customDNSServer != "" {
util.NewDialerResolver(*customDNSServer + ":53")
if !strings.Contains(*customDNSServer, ":") {
util.NewDialerResolver(*customDNSServer + ":53")
} else {
util.NewDialerResolver(*customDNSServer)
}
}
os.Setenv(util.IPCacheTimesENV, strconv.Itoa(*ipCacheTimes))
switch *serviceType {
Expand Down

0 comments on commit a36c4c1

Please sign in to comment.