{"record":{"id":"1c272485e3a5de04","repo":"AdguardTeam/AdGuardHome","slug":"collecting-dns-addresses-w","errorCode":null,"errorMessage":"collecting dns addresses: %w","messagePattern":"collecting dns addresses: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/home/control.go","lineNumber":79,"sourceCode":"\t\t\tdst = appendDNSAddrs(dst, iface.Addresses...)\n\t\t}\n\n\t\tifacesAdded = true\n\t}\n\n\treturn dst, nil\n}\n\n// collectDNSAddresses returns the list of DNS addresses the server is listening\n// on, including the addresses on all interfaces in cases of unspecified IPs.\n// extTLSConf must not be nil.\nfunc collectDNSAddresses(extTLSConf *aghtls.ExtendedTLSConfig) (addrs []string, err error) {\n\tif hosts := config.DNS.BindHosts; len(hosts) == 0 {\n\t\taddrs = appendDNSAddrs(addrs, netutil.IPv4Localhost())\n\t} else {\n\t\taddrs, err = appendDNSAddrsWithIfaces(addrs, hosts)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"collecting dns addresses: %w\", err)\n\t\t}\n\t}\n\n\tde := getDNSEncryption(extTLSConf)\n\tif de.https != \"\" {\n\t\taddrs = append(addrs, de.https)\n\t}\n\n\tif de.tls != \"\" {\n\t\taddrs = append(addrs, de.tls)\n\t}\n\n\tif de.quic != \"\" {\n\t\taddrs = append(addrs, de.quic)\n\t}\n\n\treturn addrs, nil\n}","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/AdguardTeam/AdGuardHome/blob/b41aefbe51c8dde65e2c50f093996afa0502edf9/internal/home/control.go#L61-L97","documentation":"The status handler could not build the list of DNS server addresses because expanding bind hosts failed (typically the wrapped network-interface error from appendDNSAddrsWithIfaces).","triggerScenarios":"GET /control/status with wildcard DNS bind hosts when interface enumeration errors, propagated from collectDNSAddresses's inner call.","commonSituations":"Same as the underlying interface enumeration failure: restricted containers, netns oddities, transient interface state.","solutions":["Resolve the underlying interface enumeration error (see wrapped message)","Change dns.bind_hosts from wildcards to explicit interface IPs","Verify host networking health (ip link) and restart if transient"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Surface a partial status instead of failing the whole endpoint\naddrs, err := collectDNSAddresses(tlsConf)\nif err != nil { addrs = nil /* omit addresses in response */ }","preventionTips":["Avoid wildcard bind hosts on hosts with flaky interface state","Monitor net.Interfaces health in restricted environments"],"tags":["dns","status-api","network"],"backgroundTag":"network-interface-enumeration-failed","analyzedSha":"b41aefbe51c8dde65e2c50f093996afa0502edf9","analyzedAt":"2026-08-27T04:57:55.097Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}