fix(check_zone_serial): use net.JoinHostPort

This commit is contained in:
Emmanuel BENOîT 2023-11-02 11:42:19 +01:00
parent bad82cf32d
commit 8feb34bbe6
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg

View file

@ -2,6 +2,7 @@ package main
import (
"fmt"
"net"
"os"
"reflect"
"strings"
@ -31,7 +32,7 @@ type (
// Query a zone's SOA record through a given DNS and return the response using the channel.
func queryZoneSOA(dnsq *dns.Msg, hostname string, port int, output responseChannel) {
dnsc := new(dns.Client)
in, rtt, err := dnsc.Exchange(dnsq, fmt.Sprintf("%s:%d", hostname, port))
in, rtt, err := dnsc.Exchange(dnsq, net.JoinHostPort(hostname, fmt.Sprintf("%d", port)))
output <- queryResponse{
data: in,
rtt: rtt,