diff --git a/cmd/kubeadm/app/preflight/checks.go b/cmd/kubeadm/app/preflight/checks.go index 2d3b4d5107e..544720a13f0 100644 --- a/cmd/kubeadm/app/preflight/checks.go +++ b/cmd/kubeadm/app/preflight/checks.go @@ -243,6 +243,13 @@ func (hc HostnameCheck) Check() (warnings, errors []error) { for _, msg := range validation.ValidateNodeName(hostname, false) { errors = append(errors, fmt.Errorf("hostname \"%s\" %s", hostname, msg)) } + addr, err := net.LookupHost(hostname) + if addr == nil { + errors = append(errors, fmt.Errorf("hostname \"%s\" could not be reached", hostname)) + } + if err != nil { + errors = append(errors, fmt.Errorf("hostname \"%s\" %s", hostname, err)) + } return nil, errors }