{"record":{"id":"66d8efadb3a7765a","repo":"louislam/uptime-kuma","slug":"unable-to-resolve-steam-server-hostname-hostnam","errorCode":null,"errorMessage":"Unable to resolve Steam server hostname \"${hostname}\": ${error.message}","messagePattern":"Unable to resolve Steam server hostname \"(.+?)\": (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/monitor-types/steam.js","lineNumber":127,"sourceCode":"     */\n    async resolveSteamHostname(hostname) {\n        if (net.isIP(hostname)) {\n            return hostname;\n        }\n\n        try {\n            const lookupResult = await this.lookup(hostname, { all: true });\n            const addresses = Array.isArray(lookupResult) ? lookupResult : [lookupResult];\n            const ipv4Address = addresses.find(({ address }) => net.isIP(address) === 4);\n            const resolvedAddress = ipv4Address?.address || addresses[0]?.address;\n\n            if (!resolvedAddress) {\n                throw new Error(\"DNS lookup returned no addresses\");\n            }\n\n            return resolvedAddress;\n        } catch (error) {\n            throw new Error(`Unable to resolve Steam server hostname \"${hostname}\": ${error.message}`);\n        }\n    }\n}\n\nmodule.exports = {\n    SteamMonitorType,\n};\n","sourceCodeStart":109,"sourceCodeEnd":135,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/monitor-types/steam.js#L109-L135","documentation":"Thrown from the catch block of resolveSteamHostname() when the underlying dns.lookup call rejects. The original error (ENOTFOUND, EAI_AGAIN, EAI_NONAME, etc.) is captured and re-thrown as a descriptive wrapper so the heartbeat message shows which hostname failed and why.","triggerScenarios":"Produced when node:dns/promises lookup() throws — hostname does not exist (ENOTFOUND), DNS server timed out (EAI_AGAIN), resolver misconfigured, network down, or a transient resolver failure. Also wraps the 'No addresses' guard from the try-block when the inner throw propagates to the catch.","commonSituations":"Typo in the Steam server hostname; hostname only resolvable on an internal DNS the Uptime-Kuma host cannot reach; DNS server temporarily unreachable; the hostname was retired; the underlying lookup error 126 ('DNS lookup returned no addresses') is also re-wrapped here because the inner throw is caught.","solutions":["Run nslookup/dig for the hostname from the Uptime-Kuma host to reproduce the resolver error.","Fix typos and confirm the hostname is correct and publicly resolvable.","If internal DNS is required, configure the host resolver or /etc/resolv.conf accordingly.","Use the server's IP address directly to eliminate DNS as a variable, then investigate the hostname separately."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Cheap pre-check that the hostname is plausible before delegating to dns.lookup.\nfunction isValidHostname(h) { return typeof h === \"string\" && h.length > 0 && h.length <= 253 && /^[A-Za-z0-9.:-]+$/.test(h); }","typeGuard":"function isResolvableHost(h) { return !net.isIP(h) && isValidHostname(h); }","tryCatchPattern":"try { return await this.lookup(hostname, { all: true }); }\ncatch (e) { throw new Error(`Unable to resolve Steam server hostname \"${hostname}\": ${e.message}`, { cause: e }); }","preventionTips":["Run dig/nslookup on the host before relying on the monitor.","Configure /etc/resolv.conf to a reachable resolver.","Fall back to a literal IP when DNS is flaky."],"tags":["steam","dns","resolution","error-wrapping"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}