vitessio/vitess · error
Error looking up dns name [%v]: (%v)
Error message
Error looking up dns name [%v]: (%v)
What it means
dnsLookup wraps net.LookupHost for DNSTracker. This error means the DNS query for the given hostname failed entirely — the resolver returned an error (NXDOMAIN, timeout, server failure) rather than an address list.
Source
Thrown at go/netutil/netutil.go:112
// If the FQDN isn't returned by this function, check the order in the entry
// in your /etc/hosts file.
return strings.TrimSuffix(resolvedHostnames[0], "."), nil
}
// FullyQualifiedHostnameOrPanic is the same as FullyQualifiedHostname
// but panics in case of an error.
func FullyQualifiedHostnameOrPanic() string {
hostname, err := FullyQualifiedHostname()
if err != nil {
panic(err)
}
return hostname
}
func dnsLookup(host string) ([]net.IP, error) {
addrs, err := net.LookupHost(host)
if err != nil {
return nil, fmt.Errorf("Error looking up dns name [%v]: (%v)", host, err)
}
naddr := make([]net.IP, len(addrs))
for i, a := range addrs {
naddr[i] = net.ParseIP(a)
}
sort.Slice(naddr, func(i, j int) bool {
return bytes.Compare(naddr[i], naddr[j]) < 0
})
return naddr, nil
}
// DNSTracker is a closure that persists state for
//
// tracking changes in the DNS resolution of a target dns name
// returns true if the DNS name resolution has changed
// If there is a lookup problem, we pretend nothing has changed
func DNSTracker(host string) func() (bool, error) {
dnsName := hostView on GitHub (pinned to 01a25a7d17)
Solutions
- Verify the hostname resolves: `nslookup <host>` from the Vitess host; fix DNS or /etc/hosts if not
- Remove stale entries pointing at deleted hosts from your topology/service discovery
- Check resolver config (/etc/resolv.conf) and DNS server health
- Restart/retry after DNS recovers — DNSTracker will keep failing until lookup succeeds
Example fix
// /etc/hosts, before (stale or missing entry for vttablet-1) // after 10.0.0.6 vttablet-1.example.com vttablet-1
Defensive patterns
Strategy: retry
Validate before calling
func hostResolvable(host string) error {
_, err := net.LookupHost(host)
return err // check before registering with DNSTracker
} Try / catch
addrs, err := net.LookupHost(host)
if err != nil {
// retry with backoff before giving up
return retry.Do(func() error { _, err = net.LookupHost(host); return err })
} Prevention
- Verify DNS resolution of tablet hostnames before wiring them into DNSTracker
- Monitor DNS server health; use local caching resolver (nscd/dnsmasq) with /etc/hosts fallback
- Clean up service discovery entries when tablets are decommissioned
When it happens
Trigger: DNSTracker (or the anonymous refresh closure it builds) calls dnsLookup on a hostname that no longer resolves, or while the DNS resolver is down/timeouting during a checkAndRefreshDNS call.
Common situations: Tablet removed from DNS but still tracked; DNS server outage or network partition; typo in hostname used to construct connections; k8s service deleted while vtgate keeps its address.
Related errors
- FullyQualifiedHostname: failed to lookup the IP of this mach
- FullyQualifiedHostname: failed to retrieve the hostname of t
- FullyQualifiedHostname: lookup of the IP of this machine's h
- FullyQualifiedHostname: failed to reverse lookup this machin
- FullyQualifiedHostname: reverse lookup of this machine's loc
AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01).
Data as JSON: /api/errors/10147e2ad95f4c9c.
Report an issue: GitHub.