{"record":{"id":"0f9f4347555c3523","repo":"AdguardTeam/AdGuardHome","slug":"cannot-get-network-interfaces-w","errorCode":null,"errorMessage":"cannot get network interfaces: %w","messagePattern":"cannot get network interfaces: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/home/control.go","lineNumber":57,"sourceCode":"// dst.  It also adds the IP addresses of all network interfaces if src contains\n// an unspecified IP address.\nfunc appendDNSAddrsWithIfaces(dst []string, src []netip.Addr) (res []string, err error) {\n\tifacesAdded := false\n\tfor _, h := range src {\n\t\tif !h.IsUnspecified() {\n\t\t\tdst = appendDNSAddrs(dst, h)\n\n\t\t\tcontinue\n\t\t} else if ifacesAdded {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Add addresses of all network interfaces for addresses like\n\t\t// \"0.0.0.0\" and \"::\".\n\t\tvar ifaces []*aghnet.NetInterface\n\t\tifaces, err = aghnet.GetValidNetInterfacesForWeb()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot get network interfaces: %w\", err)\n\t\t}\n\n\t\tfor _, iface := range ifaces {\n\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())","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/AdguardTeam/AdGuardHome/blob/b41aefbe51c8dde65e2c50f093996afa0502edf9/internal/home/control.go#L39-L75","documentation":"While expanding wildcard DNS bind addresses (0.0.0.0/::) into concrete addresses for the status API, enumeration of network interfaces via aghnet.GetValidNetInterfacesForWeb failed. The wrapped error comes from net.Interfaces.","triggerScenarios":"GET /control/status when DNS bind hosts contain wildcard addresses and the OS fails to enumerate interfaces (net.Interfaces error).","commonSituations":"Containerized environments with restricted /sys or netlink, heavily chrooted processes, interfaces disappearing mid-enumeration, OS-level networking stack issues.","solutions":["Check the wrapped error for the syscall-level cause","In containers, ensure adequate network namespace visibility (avoid --network none with wildcard binds, run with normal netns)","Restart the service if the failure was transient interface churn","Bind DNS to explicit IPs instead of 0.0.0.0 to bypass interface enumeration"],"exampleFix":"# before\ndns:\n  bind_hosts: [0.0.0.0]\n# after\ndns:\n  bind_hosts: [192.168.1.10]","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Catch and degrade: report status without expanded addresses\nif err != nil { addrs = []string{\"unavailable\"} }","preventionTips":["Prefer explicit bind IPs over 0.0.0.0 in containers","Ensure containers run with a normal network namespace"],"tags":["dns","network","interfaces","status-api"],"backgroundTag":"network-interface-enumeration-failed","analyzedSha":"b41aefbe51c8dde65e2c50f093996afa0502edf9","analyzedAt":"2026-08-27T04:57:55.097Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}