{"record":{"id":"642d3b413231020a","repo":"louislam/uptime-kuma","slug":"no-resolver-servers-specified-please-specify-at-l","errorCode":null,"errorMessage":"No Resolver Servers specified. Please specify at least one resolver server like 1.1.1.1 or a hostname","messagePattern":"No Resolver Servers specified\\. Please specify at least one resolver server like 1\\.1\\.1\\.1 or a hostname","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/monitor-types/dns.js","lineNumber":124,"sourceCode":"     * We are primarily doing this to support hostnames of docker containers like adguard.\n     *\n     * - Whitespace is removed from the input string\n     * - Empty entries are ignored\n     * - IP literals (IPv4 / IPv6) are accepted as-is\n     * - Hostnames are resolved to both A and AAAA records in parallel\n     * - Invalid or unresolvable entries are logged and skipped\n     * @param {string} dnsResolveServer - Comma-separated list of resolver servers (IPs or hostnames)\n     * @returns {Promise<Array<string>>} Array of resolved IP addresses\n     * @throws {Error} If no valid resolver servers could be parsed or resolved\n     */\n    async resolveDnsResolverServers(dnsResolveServer) {\n        // Remove all spaces, split into array, remove all elements that are empty\n        const addresses = dnsResolveServer\n            .replace(/\\s/g, \"\")\n            .split(\",\")\n            .filter((x) => x !== \"\");\n        if (!addresses.length) {\n            throw new Error(\n                \"No Resolver Servers specified. Please specify at least one resolver server like 1.1.1.1 or a hostname\"\n            );\n        }\n        const resolver = new Resolver();\n\n        // Make promises to be resolved concurrently\n        const promises = addresses.map(async (e) => {\n            if (net.isIP(e)) {\n                // If IPv4 or IPv6 addr, immediately return\n                return [e];\n            }\n\n            // Otherwise, attempt to resolve hostname\n            const [v4, v6] = await Promise.allSettled([resolver.resolve4(e), resolver.resolve6(e)]);\n\n            const addrs = [\n                ...(v4.status === \"fulfilled\" ? v4.value : []),\n                ...(v6.status === \"fulfilled\" ? v6.value : []),","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/monitor-types/dns.js#L106-L142","documentation":"Thrown by DnsMonitorType.resolveDnsResolverServers(dnsResolveServer) when the input, after removing all whitespace and splitting on commas, yields zero non-empty entries. The DNS monitor needs at least one resolver to build the Resolver it queries against.","triggerScenarios":"Save or run a DNS monitor whose dnsResolveServer field is \"\", \"   \", \",,,\", or only commas/spaces. The regex /\\s/g strips all whitespace before splitting.","commonSituations":"User clears the resolver field expecting a default; default is not applied here. Field accidentally set to a comma separator only. Migration that null-coalesced to empty string.","solutions":["Set dnsResolveServer to at least one IP (e.g. \"1.1.1.1\") or resolvable hostname, comma-separated for multiple.","Provide a default in your config layer when the field is blank: value || \"1.1.1.1\".","Trim and validate the field length in the UI/API before reaching the monitor runtime."],"exampleFix":"// before\n{ type: \"dns\", dnsResolveServer: \"\" }\n// after\n{ type: \"dns\", dnsResolveServer: \"1.1.1.1,8.8.8.8\" }","handlingStrategy":"validation","validationCode":"function hasResolver(s) {\n  return typeof s === \"string\" && s.replace(/\\s/g, \"\").split(\",\").filter(x => x !== \"\").length > 0;\n}","typeGuard":"function isNonEmptyResolverList(s) {\n  return typeof s === \"string\" && s.replace(/\\s/g, \"\").split(\",\").filter(Boolean).length > 0;\n}","tryCatchPattern":"try {\n  await dnsMonitor.monitor(...);\n} catch (e) {\n  if (/No Resolver Servers specified/.test(e.message)) return badRequest(\"dnsResolveServer is required\");\n  throw e;\n}","preventionTips":["Default the resolver field to 1.1.1.1 in the form.","Validate non-empty before saving the DNS monitor."],"tags":["monitor","dns","validation","network","uptime-kuma"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}