From f00f09f19cf226e33c68fb2b12d59b77f8f9d2fc Mon Sep 17 00:00:00 2001 From: Philipp Kern Date: Sun, 7 Feb 2016 00:12:48 +0100 Subject: [PATCH] Allow to specify RFC2136_NAMESERVER without the port. Append the default DNS port if the nameserver specification does not contain any. --- acme/dns_challenge_rfc2136.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/acme/dns_challenge_rfc2136.go b/acme/dns_challenge_rfc2136.go index 35f983e9..e2954d25 100644 --- a/acme/dns_challenge_rfc2136.go +++ b/acme/dns_challenge_rfc2136.go @@ -2,6 +2,7 @@ package acme import ( "fmt" + "strings" "time" "github.com/miekg/dns" @@ -20,9 +21,13 @@ type DNSProviderRFC2136 struct { // NewDNSProviderRFC2136 returns a new DNSProviderRFC2136 instance. // To disable TSIG authentication 'tsigAlgorithm, 'tsigKey' and 'tsigSecret' must be set to the empty string. -// 'nameserver' must be a network address in the the form "host:port". 'zone' must be the fully +// 'nameserver' must be a network address in the the form "host" or "host:port". 'zone' must be the fully // qualified name of the zone. func NewDNSProviderRFC2136(nameserver, zone, tsigAlgorithm, tsigKey, tsigSecret string) (*DNSProviderRFC2136, error) { + // Append the default DNS port if none is specified. + if !strings.Contains(nameserver, ":") { + nameserver += ":53" + } d := &DNSProviderRFC2136{ nameserver: nameserver, zone: zone,