Change DoT default port to 853 (#655)
authorKakashi Liu <kakashi1000@gmail.com>
Fri, 26 Jun 2020 16:41:23 +0000 (00:41 +0800)
committerGitHub <noreply@github.com>
Fri, 26 Jun 2020 16:41:23 +0000 (17:41 +0100)
Signed-off-by: Kakashi Liu <kakashi1000@gmail.com>
prober/dns.go

index d53c7958466773b890ed9898f025b7692dee3333..5ecb6f070f81581cb881002f610dc85353041ed4 100644 (file)
@@ -175,7 +175,11 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
        targetAddr, port, err := net.SplitHostPort(target)
        if err != nil {
                // Target only contains host so fallback to default port and set targetAddr as target.
-               port = "53"
+               if module.DNS.DNSOverTLS {
+                       port = "853"
+               } else {
+                       port = "53"
+               }
                targetAddr = target
        }
        ip, _, err = chooseProtocol(ctx, module.DNS.IPProtocol, module.DNS.IPProtocolFallback, targetAddr, registry, logger)