{"record":{"id":"10147e2ad95f4c9c","repo":"vitessio/vitess","slug":"error-looking-up-dns-name-v-v","errorCode":null,"errorMessage":"Error looking up dns name [%v]: (%v)","messagePattern":"Error looking up dns name \\[(.+?)\\]: \\((.+?)\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/netutil/netutil.go","lineNumber":112,"sourceCode":"\t// If the FQDN isn't returned by this function, check the order in the entry\n\t// in your /etc/hosts file.\n\treturn strings.TrimSuffix(resolvedHostnames[0], \".\"), nil\n}\n\n// FullyQualifiedHostnameOrPanic is the same as FullyQualifiedHostname\n// but panics in case of an error.\nfunc FullyQualifiedHostnameOrPanic() string {\n\thostname, err := FullyQualifiedHostname()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn hostname\n}\n\nfunc dnsLookup(host string) ([]net.IP, error) {\n\taddrs, err := net.LookupHost(host)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error looking up dns name [%v]: (%v)\", host, err)\n\t}\n\tnaddr := make([]net.IP, len(addrs))\n\tfor i, a := range addrs {\n\t\tnaddr[i] = net.ParseIP(a)\n\t}\n\tsort.Slice(naddr, func(i, j int) bool {\n\t\treturn bytes.Compare(naddr[i], naddr[j]) < 0\n\t})\n\treturn naddr, nil\n}\n\n// DNSTracker is a closure that persists state for\n//\n//\ttracking changes in the DNS resolution of a target dns name\n//\treturns true if the DNS name resolution has changed\n//\tIf there is a lookup problem, we pretend nothing has changed\nfunc DNSTracker(host string) func() (bool, error) {\n\tdnsName := host","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/netutil/netutil.go#L94-L130","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// /etc/hosts, before\n(stale or missing entry for vttablet-1)\n// after\n10.0.0.6 vttablet-1.example.com vttablet-1","handlingStrategy":"retry","validationCode":"func hostResolvable(host string) error {\n    _, err := net.LookupHost(host)\n    return err // check before registering with DNSTracker\n}","typeGuard":null,"tryCatchPattern":"addrs, err := net.LookupHost(host)\nif err != nil {\n    // retry with backoff before giving up\n    return retry.Do(func() error { _, err = net.LookupHost(host); return err })\n}","preventionTips":["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"],"tags":["network","dns","lookup","resolver"],"backgroundTag":"dns-lookup-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}