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

No DNS Search Domain support in C-Ares calls #17850

Closed
Mickael-van-der-Beek opened this issue Dec 24, 2017 · 11 comments
Closed

No DNS Search Domain support in C-Ares calls #17850

Mickael-van-der-Beek opened this issue Dec 24, 2017 · 11 comments
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. dns Issues and PRs related to the dns subsystem. feature request Issues that request new features to be added to Node.js. stale

Comments

@Mickael-van-der-Beek
Copy link

Mickael-van-der-Beek commented Dec 24, 2017

  • Version: node:9.2.0-slim (Docker image)
  • Platform: Linux 8f48fe466727 4.9.49-moby 1 SMP Fri Dec 8 13:40:02 UTC 2017 x86_64 GNU/Linux
  • Subsystem: dns

It would seem that currently, Node.js calls through the C-Ares DNS resolver (resolve4() and resolve6()) don't support search domains.

Is this a bug? If not, are there current or planned configuration options to specify them?
Should this issue be cross-posted to the C-Ares repository?

To make reproduction of this issue easier, I created a Docker-based repository that you can find here:

https://github.com/Mickael-van-der-Beek/node-dns-test

PS: Be careful to not use Alpine Linux as Docker based image due to muslc being used and not glibc. I will create a ticket about this in their repository later.

EDIT: Might be related to this issue that was supposedly fixed in the past: #9799

@starkwang starkwang added cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. dns Issues and PRs related to the dns subsystem. labels Dec 25, 2017
@bnoordhuis bnoordhuis added the feature request Issues that request new features to be added to Node.js. label Dec 25, 2017
@bnoordhuis
Copy link
Member

This is about node.js not honoring the domain or search attribute in /etc/resolv.conf? That's because we call ares_query(), not ares_search(). ares_query() does not take search domains into account.

ares_search() cannot be the default because it makes up to num_search_domains + 1 queries but we could add a { search: true } option.

@Mickael-van-der-Beek
Copy link
Author

@bnoordhuis I see, good to know. Thanks for the quick answer.

The situation we encountered at my company is that we use a VPN to connect to our Kubernetes cluster. Services can have multiple instances and use DNS hostnames to load balance to one or the other (through KubeDNS). We also put these hostnames behind subdomains of one of our domains so that even development services benefit of our TLS certificate.

Since the hostnames are a bit long outside of the Kubernetes internal network, we let the VPN access the Kuberenetes DNS resolver to allow for short-hand service hostnames usage on our development machines.

@bcorijn Correct me if I'm wrong?

Not the most common use case of course, more of a convenience thing. So I understand if this isn't a priority.

It did take us a bit of time to understand why certain apps were affected or not because some DNS resolutions used dns.lookup() which worked fine in this case and others were using dns.resolve() which didn't.

@bnoordhuis bnoordhuis added c++ Issues and PRs that require attention from people who are familiar with C++. good first issue Issues that are suitable for first-time contributors. labels Feb 17, 2018
@Manicqin
Copy link

Manicqin commented Mar 4, 2018

Hi, If this issue is still open I can take it.

@bnoordhuis
Copy link
Member

@Manicqin You mean adding a search option? Go for it; no one is working on it, AFAIK.

Manicqin added a commit to Manicqin/node that referenced this issue Mar 23, 2018
lib: dns.js - passing the search field form the options object to
              QueryReqWrap object.

src:
base_object.h - added GetField function to read fields from the
                persistent object (persistent QueryReqWrap object).

cares_wrap.cc - added a AresSearch function.
              - QueryAWrap (resolve4) and QueryAaaaWrap (resolve6)
              utilizes the AresSearch when options.search is true.

doc/api: added search option to the resolve4 and resolve6 documentation

Fixes: nodejs#17850
@UtkarshGupta-CS
Copy link

@Manicqin will you be able to resolve this issue or can I take up this issue?

@UtkarshGupta-CS
Copy link

@bnoordhuis Can I work on this issue?

@bnoordhuis
Copy link
Member

Sure. The other pull request looks to have stalled.

@SirR4T
Copy link
Contributor

SirR4T commented Aug 10, 2018

@bnoordhuis took a shot in #22226 , based on your review suggestions in #19548 . complete noob at C++, though, so might require a bit of handholding. Also, need guidance in writing tests.

@fhinkel
Copy link
Member

fhinkel commented Oct 30, 2019

Should this remain open?

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2022

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2022

There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot closed this as completed Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. dns Issues and PRs related to the dns subsystem. feature request Issues that request new features to be added to Node.js. stale
Projects
None yet
8 participants