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

[DNS] Reverse DNS resolution returns - (dash) character #4229

Closed
Mickael-van-der-Beek opened this issue Dec 10, 2015 · 4 comments
Closed

[DNS] Reverse DNS resolution returns - (dash) character #4229

Mickael-van-der-Beek opened this issue Dec 10, 2015 · 4 comments
Labels
dns Issues and PRs related to the dns subsystem. question Issues that look for answers.

Comments

@Mickael-van-der-Beek
Copy link

I encountered a strange behaviour on the dns.reverse() method. e.g:

If you resolve the domain name www.fagron.com to an IP address:

dns.resolve4('www.fagron.com', function (e, addresses) {
    console.log(addresses); // [ '87.233.241.210' ]
});

If you now re-use this IPv4 address and do a reverse DNS resolution:

dns.reverse('87.233.241.210', function (e, hostnames) {
    console.log(hostnames); // [ '-' ]
});

It seems fairly strange that the returned value is a - dash character (45) since you would expect that:

  • if an error occurred, the error is returned and the hostnames argument is undefined
  • if no hostname is found at all, the hostnames argument is an empty array []

Node.js version is: v4.2.2
Operating system version is: Darwin myhostname.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64

@ChALkeR
Copy link
Member

ChALkeR commented Dec 10, 2015

$ dig +noall +answer -x 87.233.241.210
210.241.233.87.in-addr.arpa. 86366 IN   PTR     -.

That's what DNS actually returns. There is nothing that Node.js could or should do here.

@ChALkeR ChALkeR added the dns Issues and PRs related to the dns subsystem. label Dec 10, 2015
@Mickael-van-der-Beek
Copy link
Author

@ChALkeR Thanks for the quick answer.

Is this part of the DNS protocol ? I can't find information anywhere about a possible - dash character as a return value even after looking through the Node.js and C-Ares source codes.

@bnoordhuis
Copy link
Member

It's technically legal, the RDATA field in PTR records is free-form. Suggest close?

@Mickael-van-der-Beek
Copy link
Author

It might be interesting to mention this in the DNS core module documentation if that's the case because otherwise anyone that does not validate the hostnames returned will encounter unnecessary errors further down the pipeline.

Yup, the issue can be closed. Thanks for the information!

@ChALkeR ChALkeR added the question Issues that look for answers. label Dec 10, 2015
aduh95 pushed a commit that referenced this issue Dec 4, 2023
Original commit message:
  aix: disable ipv6 link local (#4229)

  AIX does not implement ifaddrs and when retrieving the network
  interfaces with uv_interface_addresses there was a test failure in
  tcp_connect6_link_local.

  For now disable ipv6 link local on aix to:

  1) fix broken aix build
  2) stop blocking libuv upgrade in node

  Refs: libuv/libuv#4222 (comment)
  Refs: #50650

Refs: libuv/libuv@bfbe4e3
nodejs-github-bot pushed a commit that referenced this issue Dec 4, 2023
Original commit message:
  aix: disable ipv6 link local (#4229)

  AIX does not implement ifaddrs and when retrieving the network
  interfaces with uv_interface_addresses there was a test failure in
  tcp_connect6_link_local.

  For now disable ipv6 link local on aix to:

  1) fix broken aix build
  2) stop blocking libuv upgrade in node

  Refs: libuv/libuv#4222 (comment)
  Refs: #50650

Refs: libuv/libuv@bfbe4e3
PR-URL: #50650
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
RafaelGSS pushed a commit that referenced this issue Dec 15, 2023
Original commit message:
  aix: disable ipv6 link local (#4229)

  AIX does not implement ifaddrs and when retrieving the network
  interfaces with uv_interface_addresses there was a test failure in
  tcp_connect6_link_local.

  For now disable ipv6 link local on aix to:

  1) fix broken aix build
  2) stop blocking libuv upgrade in node

  Refs: libuv/libuv#4222 (comment)
  Refs: #50650

Refs: libuv/libuv@bfbe4e3
PR-URL: #50650
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dns Issues and PRs related to the dns subsystem. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

3 participants