{"record":{"id":"fe986c7fe7351f25","repo":"nodejs/node","slug":"ares-set-serveres-csv-s","errorCode":null,"errorMessage":"ares_set_serveres_csv: %s\n","messagePattern":"ares_set_serveres_csv: (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/cares/src/tools/ahost.c","lineNumber":155,"sourceCode":"  }\n\n  argc -= state.optind;\n  argv += state.optind;\n  if (argc < 1) {\n    usage();\n  }\n\n  status = ares_init_options(&channel, &options, optmask);\n  if (status != ARES_SUCCESS) {\n    free(servers);\n    fprintf(stderr, \"ares_init: %s\\n\", ares_strerror(status));\n    return 1;\n  }\n\n  if (servers) {\n    status = ares_set_servers_csv(channel, servers);\n    if (status != ARES_SUCCESS) {\n      fprintf(stderr, \"ares_set_serveres_csv: %s\\n\", ares_strerror(status));\n      free(servers);\n      usage();\n      return 1;\n    }\n    free(servers);\n  }\n\n  /* Initiate the queries, one per command-line argument. */\n  for (; *argv; argv++) {\n    if (ares_inet_pton(AF_INET, *argv, &addr4) == 1) {\n      ares_gethostbyaddr(channel, &addr4, sizeof(addr4), AF_INET, callback,\n                         *argv);\n    } else if (ares_inet_pton(AF_INET6, *argv, &addr6) == 1) {\n      ares_gethostbyaddr(channel, &addr6, sizeof(addr6), AF_INET6, callback,\n                         *argv);\n    } else {\n      struct ares_addrinfo_hints hints;\n      memset(&hints, 0, sizeof(hints));","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/cares/src/tools/ahost.c#L137-L173","documentation":"Printed by ahost's main() at ahost.c:155 when ares_set_servers_csv() fails to apply the user-provided server list. Note the message itself contains a typo ('ares_set_serveres_csv' with an extra 'e') — this is a bug in the source string at line 155, not a different function. The ares_strerror(status) detail identifies the parsing or application failure. The tool frees servers, calls usage(), and returns 1.","triggerScenarios":"Calling ares_set_servers_csv(channel, servers) at line 152, where servers was set via -s. Fails when the CSV string contains unparseable IP addresses, unsupported formats, or empty entries. Unlike adig's version (which uses ares_set_servers_ports_csv with port support), ahost uses ares_set_servers_csv which does not parse port suffixes.","commonSituations":"A user passes a port-qualified server string like '8.8.8.8:53' to ahost, but ares_set_servers_csv may not parse port suffixes (unlike adig's _ports_ variant). Passing multiple comma-separated servers in a format the function does not accept. Passing a non-IP string. This message also has a cosmetic typo ('serveres') that has been present in the source.","solutions":["Pass only bare IP addresses to ahost -s: 'ahost -s 8.8.8.8 example.com' (no port suffix).","For multiple servers, use the CSV format accepted by ares_set_servers_csv: 'ahost -s 8.8.8.8,1.1.1.1 example.com'.","Check the ares_strerror() output for the specific parse failure.","Note the message typo ('serveres') is cosmetic and does not indicate a different function — the actual call is to ares_set_servers_csv."],"exampleFix":"// before: port suffix not supported by ares_set_servers_csv\nahost -s '8.8.8.8:53' example.com\n// -> 'ares_set_serveres_csv: ...' (note typo in message)\n\n// after: bare IP without port\nahost -s '8.8.8.8' example.com","handlingStrategy":"validation","validationCode":"// Validate server IPs before passing to ahost -s\nvalidate_ip() {\n    local ip=\"$1\"\n    # ares_set_servers_csv expects bare IPs, no port\n    if ! [[ \"$ip\" =~ ^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$ ]]; then\n        echo \"invalid server IP: $ip\" >&2; return 1\n    fi\n}\nvalidate_ip \"$SERVER_IP\" && ahost -s \"$SERVER_IP\" \"$DOMAIN\"","typeGuard":null,"tryCatchPattern":"status = ares_set_servers_csv(channel, servers);\nif (status != ARES_SUCCESS) {\n    fprintf(stderr, \"servers CSV rejected: %s\\n\", servers);\n    // fall back to system-configured DNS servers\n    // (don't call ares_set_servers_csv at all)\n}","preventionTips":["Pass bare IP addresses to ahost -s (no port suffix, unlike adig).","For multiple servers, use comma-separated format: '8.8.8.8,1.1.1.1'.","Note the message has a cosmetic typo ('serveres') — the actual function is ares_set_servers_csv."],"tags":["c-ares","ahost","dns-servers","configuration","typo-in-message"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}