Skip to content

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

Closed

Description

@Mickael-van-der-Beek
  • 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

Activity

  1. added
    caresIssues and PRs related to the c-ares dependency or the cares_wrap binding.
    dnsIssues and PRs related to the dns subsystem.
    on Dec 25, 2017
  2. bnoordhuis commented on Dec 25, 2017

    @bnoordhuis
    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.

  3. Mickael-van-der-Beek commented on Dec 25, 2017

    @Mickael-van-der-Beek
    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.

  4. added
    c++Issues and PRs that require attention from people who are familiar with C++.
    good first issueIssues that are suitable for first-time contributors.
    on Feb 17, 2018
  5. Manicqin commented on Mar 4, 2018

    @Manicqin

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

  6. bnoordhuis commented on Mar 4, 2018

    @bnoordhuis
    Member

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

  7. UtkarshGupta-CS commented on Jun 10, 2018

    @UtkarshGupta-CS

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

  8. UtkarshGupta-CS commented on Jun 11, 2018

    @UtkarshGupta-CS

    @bnoordhuis Can I work on this issue?

  9. bnoordhuis commented on Jun 11, 2018

    @bnoordhuis
    Member

    Sure. The other pull request looks to have stalled.

  10. SirR4T commented on Aug 10, 2018

    @SirR4T

    @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.

  11. fhinkel commented on Oct 30, 2019

    @fhinkel
    Contributor

    Should this remain open?

  12. github-actions commented on Mar 4, 2022

    @github-actions
    Contributor

    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.

  13. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Mar 4, 2022
  14. github-actions commented on Apr 4, 2022

    @github-actions
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.caresIssues and PRs related to the c-ares dependency or the cares_wrap binding.dnsIssues and PRs related to the dns subsystem.feature requestIssues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions