From 3edb4c3c6c34bd8f8107e2b4035d0b9bc622a346 Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Wed, 4 Dec 2019 11:46:29 +0000 Subject: [PATCH] Remove IP address validation on dns01-recursive-nameservers to allow domain names Signed-off-by: Andrew Haines --- cmd/controller/app/options/options.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/cmd/controller/app/options/options.go b/cmd/controller/app/options/options.go index b26bcd745..dd94c9aed 100644 --- a/cmd/controller/app/options/options.go +++ b/cmd/controller/app/options/options.go @@ -261,7 +261,7 @@ func (s *ControllerOptions) AddFlags(fs *pflag.FlagSet) { "Group of the Issuer to use when the tls is requested but issuer group is not specified on the ingress resource.") fs.StringSliceVar(&s.DNS01RecursiveNameservers, "dns01-recursive-nameservers", []string{}, "A list of comma seperated dns server endpoints used for "+ - "DNS01 check requests. This should be a list containing IP address and "+ + "DNS01 check requests. This should be a list containing host and "+ "port, for example 8.8.8.8:53,8.8.4.4:53") fs.BoolVar(&s.DNS01RecursiveNameserversOnly, "dns01-recursive-nameservers-only", defaultDNS01RecursiveNameserversOnly, @@ -272,8 +272,8 @@ func (s *ControllerOptions) AddFlags(fs *pflag.FlagSet) { "due to caching performed by the recursive nameservers.") fs.StringSliceVar(&s.DNS01RecursiveNameservers, "dns01-self-check-nameservers", []string{}, "A list of comma seperated dns server endpoints used for "+ - "DNS01 check requests. This should be a list containing IP address and "+ - "port, for example 8.8.8.8:53,8.8.4.4:53") + "DNS01 check requests. This should be a list containing host and port, "+ + "for example 8.8.8.8:53,8.8.4.4:53") fs.MarkDeprecated("dns01-self-check-nameservers", "Deprecated in favour of dns01-recursive-nameservers") fs.BoolVar(&s.EnableCertificateOwnerRef, "enable-certificate-owner-ref", defaultEnableCertificateOwnerRef, ""+ "Whether to set the certificate resource as an owner of secret where the tls certificate is stored. "+ @@ -301,14 +301,10 @@ func (o *ControllerOptions) Validate() error { for _, server := range o.DNS01RecursiveNameservers { // ensure all servers have a port number - host, _, err := net.SplitHostPort(server) + _, _, err := net.SplitHostPort(server) if err != nil { return fmt.Errorf("invalid DNS server (%v): %v", err, server) } - ip := net.ParseIP(host) - if ip == nil { - return fmt.Errorf("invalid IP address: %v", host) - } } return nil }