kubernetes-up-and-running / kuard

Demo app for Kubernetes Up and Running book
Apache License 2.0
1.56k stars 535 forks source link

Support IPv6 DNS #46

Open jipperinbham opened 2 years ago

jipperinbham commented 2 years ago

When attempting to use kuard where /etc/resolv.conf contained an IPv6 for the nameserver, it would error when making the DNS query due to net.Dial expecting the IP to be surround with square brackets. In order to detect if it's IPv6, it parses the IP string to a net.IP and relies on To4() returning nil for determining it's not a v4 and so must be a v6.