vitessio/vitess · warning
Connection DNS for %s reporting as empty, ignoring
Error message
Connection DNS for %s reporting as empty, ignoring
What it means
DNSTracker's refresh closure calls dnsLookup and requires at least one address for the tracked hostname. This error is the defensive guard for a successful lookup that inexplicably returns an empty IP list; the tracker refuses to update its cached addresses in that case.
Source
Thrown at go/netutil/netutil.go:145
// 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 := host
var addrs []net.IP
if dnsName != "" {
addrs, _ = dnsLookup(dnsName)
}
return func() (bool, error) {
if dnsName == "" {
return false, nil
}
newaddrs, err := dnsLookup(dnsName)
if err != nil {
return false, err
}
if len(newaddrs) == 0 { // Should not happen, but just in case
return false, fmt.Errorf("Connection DNS for %s reporting as empty, ignoring", dnsName)
}
if !addrEqual(addrs, newaddrs) {
oldaddr := addrs
addrs = newaddrs // Update the closure variable
return true, fmt.Errorf("Connection DNS for %s has changed; old: %v new: %v", dnsName, oldaddr, newaddrs)
}
return false, nil
}
}
func addrEqual(a, b []net.IP) bool {
if len(a) != len(b) {
return false
}
for idx, v := range a {
if !net.IP.Equal(v, b[idx]) {
return false
}View on GitHub (pinned to 01a25a7d17)
Solutions
- Fix the hostname's entry so it maps to at least one IP in /etc/hosts or DNS
- Inspect /etc/nsswitch.conf and resolver modules for empty-answer behavior
- Test with `getent hosts <name>` to reproduce and confirm the fix
- If recurring, replace DNSTracker usage with a resolver that handles empty answers
Example fix
// /etc/hosts, before 10.0.0.6 // after 10.0.0.6 vttablet-1.example.com vttablet-1
Defensive patterns
Strategy: retry
Validate before calling
addrs, err := net.LookupHost(dnsName)
if err != nil || len(addrs) == 0 {
return fmt.Errorf("hostname %q unusable", dnsName)
} Try / catch
changed, err := tracker.Check()
if err != nil {
log.Warn("DNS refresh failed; will retry next cycle", slog.Any("error", err))
// keep old cached addresses; retry on next check
} Prevention
- Ensure hostnames in /etc/hosts include a valid address field
- Test `getent hosts <name>` for tracked hostnames during deploy validation
- Avoid custom NSS modules that return empty success
When it happens
Trigger: A DNSTracker checkAndRefreshDNS cycle where net.LookupHost succeeds for the connection's DNS name but returns zero IPs.
Common situations: Custom resolver/NSS modules returning empty success; unusual DNS responses with no answers; hostname present in /etc/hosts with malformed/missing address field.
Related errors
- FullyQualifiedHostname: failed to retrieve the hostname of t
- FullyQualifiedHostname: failed to lookup the IP of this mach
- 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/ed99fcd740163909.
Report an issue: GitHub.