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

  1. Fix the hostname's entry so it maps to at least one IP in /etc/hosts or DNS
  2. Inspect /etc/nsswitch.conf and resolver modules for empty-answer behavior
  3. Test with `getent hosts <name>` to reproduce and confirm the fix
  4. 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

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


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/ed99fcd740163909. Report an issue: GitHub.