-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dns.lookup() documentation error code #27604
Comments
I'm certainly getting |
It seems that |
Fixed in fd8d5e7 |
dns.lookup() will always return ENOTFOUND on a empty lookup or when the host not found. https://github.com/nodejs/node/blob/master/lib/internal/errors.js#L503 Fixes: nodejs#27604 PR-URL: nodejs#27625 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
dns.lookup() will always return ENOTFOUND on a empty lookup or when the host not found. https://github.com/nodejs/node/blob/master/lib/internal/errors.js#L503 Fixes: #27604 PR-URL: #27625 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The nodejs documentation for dns.lookup() seems to imply that the error will ENOENT, if a domain is not found. Should this be ENOTFOUND instead?
https://nodejs.org/docs/latest-v11.x/api/dns.html#dns_dns_lookup_hostname_options_callback
"On error, err is an Error object, where err.code is the error code. Keep in mind that err.code will be set to 'ENOENT' not only when the hostname does not exist but also when the lookup fails in other ways such as no available file descriptors."
The text was updated successfully, but these errors were encountered: