{"record":{"id":"321c5c3b77a1da4f","repo":"siyuan-note/siyuan","slug":"host-has-no-ip-address","errorCode":null,"errorMessage":"host has no IP address: ","messagePattern":"host has no IP address: ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/util/httprequest.go","lineNumber":169,"sourceCode":"\t\t\tport = \"443\"\n\t\tdefault:\n\t\t\treturn \"\", errors.New(\"URL must start with http:// or https://\")\n\t\t}\n\t}\n\n\tif ip := net.ParseIP(host); ip != nil {\n\t\tif isPrivateIP(ip) {\n\t\t\treturn \"\", errors.New(\"access to private/internal IP is prohibited\")\n\t\t}\n\t\treturn net.JoinHostPort(ip.String(), port), nil\n\t}\n\n\tips, err := t.lookupIPAddr(ctx, host)\n\tif err != nil {\n\t\treturn \"\", errors.New(\"failed to resolve host: \" + err.Error())\n\t}\n\tif len(ips) == 0 {\n\t\treturn \"\", errors.New(\"host has no IP address: \" + host)\n\t}\n\tfor _, ipAddr := range ips {\n\t\tif isPrivateIP(ipAddr.IP) {\n\t\t\treturn \"\", errors.New(\"access to private/internal IP is prohibited\")\n\t\t}\n\t}\n\treturn net.JoinHostPort(ips[0].IP.String(), port), nil\n}\n\nfunc cloneURL(src *url.URL) *url.URL {\n\tret := *src\n\treturn &ret\n}\n\nfunc dialProxyTunnel(ctx context.Context, proxyURL *url.URL, targetAddr string) (net.Conn, *bufio.Reader, error) {\n\tproxyAddr, err := proxyAddress(proxyURL)\n\tif err != nil {\n\t\treturn nil, nil, err","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/util/httprequest.go#L151-L187","documentation":"After a successful DNS lookup, the SSRF-safe transport checks that at least one IP address was returned. An empty result with no error is treated as a fatal input problem: the host literally has no usable address, so the request cannot be pinned to a public IP.","triggerScenarios":"Agent HTTP request through a proxy to a hostname whose DNS response contains zero A/AAAA records (e.g. a name with only CNAME chains ending nowhere, or a DNS64/NAT64 edge configuration returning an empty answer).","commonSituations":"DNS zone misconfiguration; records recently removed; enterprise resolver returning empty answers for blocked domains; custom resolver injected in tests returning no addresses.","solutions":["Confirm the domain has A/AAAA records with dig +short host A / dig +short host AAAA","Fix the DNS record at the authoritative zone or use the correct hostname","Check whether a security appliance/proxy DNS filter is stripping answers","Use a different, valid hostname for the API endpoint"],"exampleFix":"// before (subdomain without A record)\nHTTPRequest(\"GET\", \"https://stale.api.example.com\", nil, \"\")\n// after\nHTTPRequest(\"GET\", \"https://api.example.com\", nil, \"\")","handlingStrategy":"validation","validationCode":"ips, _ := net.LookupIP(host)\nif len(ips) == 0 {\n    return fmt.Errorf(\"host %s has no A/AAAA records; fix DNS before calling\", host)\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"has no IP address\") {\n    return fmt.Errorf(\"DNS zone for %s has no address records; correct the zone\", host)\n}","preventionTips":["Ensure domains used by agents have valid A/AAAA records","Watch for security appliances that return empty DNS answers for blocked domains","Monitor DNS zone health after record changes"],"tags":["dns","network","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}