{"record":{"id":"ee6b35ae655f2744","repo":"vitessio/vitess","slug":"fullyqualifiedhostname-failed-to-reverse-lookup-t","errorCode":null,"errorMessage":"FullyQualifiedHostname: failed to reverse lookup this machine's local IP (%v): %v","messagePattern":"FullyQualifiedHostname: failed to reverse lookup this machine's local IP \\((.+?)\\): (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"go/netutil/netutil.go","lineNumber":84,"sourceCode":"\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"FullyQualifiedHostname: failed to retrieve the hostname of this machine: %v\", err)\n\t}\n\n\t// 2. Look up the IP address for that hostname. Example: 127.0.0.1\n\tips, err := net.LookupHost(hostname)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"FullyQualifiedHostname: failed to lookup the IP of this machine's hostname (%v): %v\", hostname, err)\n\t}\n\tif len(ips) == 0 {\n\t\treturn \"\", fmt.Errorf(\"FullyQualifiedHostname: lookup of the IP of this machine's hostname (%v) did not return any IP address\", hostname)\n\t}\n\t// If multiple IPs are returned, we only look at the first one.\n\tlocalIP := ips[0]\n\n\t// 3. Reverse lookup the IP. Example: localhost.localdomain\n\tresolvedHostnames, err := net.LookupAddr(localIP)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"FullyQualifiedHostname: failed to reverse lookup this machine's local IP (%v): %v\", localIP, err)\n\t}\n\tif len(resolvedHostnames) == 0 {\n\t\treturn \"\", fmt.Errorf(\"FullyQualifiedHostname: reverse lookup of this machine's local IP (%v) did not return any hostnames\", localIP)\n\t}\n\t// If multiple hostnames are found, we return only the first one.\n\t// If multiple hostnames are listed e.g. in an entry in the /etc/hosts file,\n\t// the current Go implementation returns them in that order.\n\t// Example for an /etc/hosts entry:\n\t//   127.0.0.1\tlocalhost.localdomain localhost\n\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()","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/netutil/netutil.go#L66-L102","documentation":"Step 3 of FullyQualifiedHostname reverse-resolves the machine's IP via net.LookupAddr to get the FQDN. This error means the reverse DNS lookup of the local IP failed (no PTR record or resolver failure).","triggerScenarios":"FullyQualifiedHostname is called (directly or via FullyQualifiedHostnameOrPanic, backup, BuildTabletFromInput) on a host whose IP has no reverse DNS entry or whose resolver is unreachable.","commonSituations":"Cloud/private-network IPs without PTR records; DNS outage; /etc/hosts lacking a reverse mapping; using an IP like 127.0.0.1 that has no PTR in the environment.","solutions":["Add a reverse entry in /etc/hosts: \"10.0.0.5 tablet-1.example.com tablet-1\"","Create a PTR record for the host's IP in your DNS server","Provide the fully-qualified hostname explicitly to Vitess instead of relying on reverse lookup (e.g. -hostname flag / tablet hostname field)","Verify with `dig -x <localIP>` or `nslookup <localIP>`"],"exampleFix":"// /etc/hosts, before\n10.0.0.5 tablet-1\n// after\n10.0.0.5 tablet-1.example.com tablet-1","handlingStrategy":"fallback","validationCode":"ip, err := net.LookupHost(os.Hostname())\nif err == nil && len(ip) > 0 {\n    if _, err := net.LookupAddr(ip[0]); err != nil {\n        return fmt.Errorf(\"no PTR for %s: %v\", ip[0], err)\n    }\n}","typeGuard":null,"tryCatchPattern":"fqdn, err := netutil.FullyQualifiedHostname()\nif err != nil {\n    log.Warn(\"reverse DNS failed; set hostname explicitly\", slog.Any(\"error\", err))\n    fqdn = cfg.ExplicitHostname // preconfigured value\n}","preventionTips":["Create PTR records for all Vitess host IPs or add reverse entries in /etc/hosts","Prefer passing an explicit hostname (e.g. vttablet -hostname flag) in DNS-less environments","Monitor `dig -x <ip>` health in your cluster checks"],"tags":["network","dns","reverse-lookup","ptr"],"backgroundTag":"reverse-dns-lookup-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}