Skip to content
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

nodejs dns library does not like certain hostname #2106

Closed
ORESoftware opened this issue Aug 7, 2019 · 1 comment
Closed

nodejs dns library does not like certain hostname #2106

ORESoftware opened this issue Aug 7, 2019 · 1 comment

Comments

@ORESoftware
Copy link

I am on node.js version 12

https://stackoverflow.com/questions/57387217/node-js-dns-library-does-not-like-our-rds-hostname

For some reason the dns call is balking on the hostname, anybody know why?

@ORESoftware ORESoftware changed the title nodejs dns library nodejs dns library does not like certain hostname Aug 7, 2019
@ORESoftware
Copy link
Author

it doesn't like google.com either:

TypeError [ERR_INVALID_OPT_VALUE]: The value "google.com" is invalid for option "hostname"

:(

const dns = require('dns');

const getDNSInfo = (host, port) => new Promise(resolve => {
  dns.lookupService(host, port, (err, hostname, service) => {
    console.log('dns resolved:', {hostname, service, err});
    resolve({err, hostname, service});
  });
});

getDNSInfo('google.com',80).then(v => {
   console.log(v);
})
.catch(v => {
  console.error('There was an error:', v)
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant