louislam/uptime-kuma · error · Error
No Resolver Servers specified. Please specify at least one r
Error message
No Resolver Servers specified. Please specify at least one resolver server like 1.1.1.1 or a hostname
What it means
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.
Source
Thrown at server/monitor-types/dns.js:124
* We are primarily doing this to support hostnames of docker containers like adguard.
*
* - Whitespace is removed from the input string
* - Empty entries are ignored
* - IP literals (IPv4 / IPv6) are accepted as-is
* - Hostnames are resolved to both A and AAAA records in parallel
* - Invalid or unresolvable entries are logged and skipped
* @param {string} dnsResolveServer - Comma-separated list of resolver servers (IPs or hostnames)
* @returns {Promise<Array<string>>} Array of resolved IP addresses
* @throws {Error} If no valid resolver servers could be parsed or resolved
*/
async resolveDnsResolverServers(dnsResolveServer) {
// Remove all spaces, split into array, remove all elements that are empty
const addresses = dnsResolveServer
.replace(/\s/g, "")
.split(",")
.filter((x) => x !== "");
if (!addresses.length) {
throw new Error(
"No Resolver Servers specified. Please specify at least one resolver server like 1.1.1.1 or a hostname"
);
}
const resolver = new Resolver();
// Make promises to be resolved concurrently
const promises = addresses.map(async (e) => {
if (net.isIP(e)) {
// If IPv4 or IPv6 addr, immediately return
return [e];
}
// Otherwise, attempt to resolve hostname
const [v4, v6] = await Promise.allSettled([resolver.resolve4(e), resolver.resolve6(e)]);
const addrs = [
...(v4.status === "fulfilled" ? v4.value : []),
...(v6.status === "fulfilled" ? v6.value : []),View on GitHub (pinned to 6b5ea01557)
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.
Example fix
// before
{ type: "dns", dnsResolveServer: "" }
// after
{ type: "dns", dnsResolveServer: "1.1.1.1,8.8.8.8" } Defensive patterns
Strategy: validation
Validate before calling
function hasResolver(s) {
return typeof s === "string" && s.replace(/\s/g, "").split(",").filter(x => x !== "").length > 0;
} Type guard
function isNonEmptyResolverList(s) {
return typeof s === "string" && s.replace(/\s/g, "").split(",").filter(Boolean).length > 0;
} Try / catch
try {
await dnsMonitor.monitor(...);
} catch (e) {
if (/No Resolver Servers specified/.test(e.message)) return badRequest("dnsResolveServer is required");
throw e;
} Prevention
- Default the resolver field to 1.1.1.1 in the form.
- Validate non-empty before saving the DNS monitor.
When it happens
Trigger: Save or run a DNS monitor whose dnsResolveServer field is "", " ", ",,,", or only commas/spaces. The regex /\s/g strips all whitespace before splitting.
Common situations: 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.
Related errors
- Packet size must be between ${PING_PACKET_SIZE_MIN} and ${PI
- None of the configured resolver servers could be resolved to
- Service Name is required.
- Invalid service name. Please use the internal Service Name (
- Invalid PM2 process name.
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/642d3b413231020a.
Report an issue: GitHub.