Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

feat: add support for resolve drop-in replacement #16

Closed
titanism opened this issue Feb 18, 2023 · 10 comments
Closed

feat: add support for resolve drop-in replacement #16

titanism opened this issue Feb 18, 2023 · 10 comments

Comments

@titanism
Copy link

Right now we can use this for resolve4 and resolve6, but not resolve. Can this be added?

We would gladly sponsor your efforts on GitHub Sponsors.

@Kikobeats
Copy link
Owner

@titanism I guess you closed this because you see the example on the README 🙂

@titanism
Copy link
Author

No, we're actually not using this project anymore because the Packet implementation is not up to par.

We are using dns-packet instead and an example from this https://github.com/mafintosh/dns-packet/blob/master/examples/doh.js. We wrote our own 1:1 parity resolver for DoH since there were no solutions that worked for every case, including DNSSEC. This package for example does not support CAA parsing properly and results in zero answers.

@titanism
Copy link
Author

However, we appreciate all your efforts and work, as this helped us understand different approaches and implementations and the concept of DNS packets.

@Kikobeats
Copy link
Owner

Kikobeats commented Feb 19, 2023

No, we're actually not using this project anymore because the Packet implementation is not up to par.

Can you explain that? what's wrong in the Packet implementation provided by dns2?

I'll be happy to accept a PR switching from dns2 to dns-packet is that is enabling to support more use cases

@titanism
Copy link
Author

We're using https://github.com/hildjj/dohdec/tree/main/pkg/dohdec now. Also, your Packet implementation is not as good as dns-packet (yet) - as it did not work with CAA records for example (at least when we tested).

@titanism
Copy link
Author

Hi @Kikobeats 👋 Just passing along another update...

We released 🍊 Tangerine today, which is a userland package tangerine that solves DNS caching for Node.js. It's a ⚡ faster ⚡ 1:1 drop-in replacement for dns.promises.Resolver using DNS over HTTPS ("DoH") via undici with built-in retries, timeouts, smart server rotation, AbortControllers, and caching support for multiple backends via Keyv.

npm install tangerine
-import dns from 'dns';
+import Tangerine from 'tangerine';

- const resolver = new dns.promises.Resolver();
+const resolver = new Tangerine();

Documentation, API, options, source code, tests, benchmarks, and more available at https://github.com/forwardemail/tangerine.

@titanism
Copy link
Author

Also - we're happy to have you as a maintainer/contributor - PR's and help welcome if you're interested in merging efforts.

@Kikobeats
Copy link
Owner

Kikobeats commented Feb 25, 2023

That's great! Thanks for commenting back 🙂

Probably I'm going to use it since I developed this library after facing with the all well known limitations of the built-in DNS module in Node.js.

I just dropped an issue there to make me easier to migrate:
forwardemail/nodejs-dns-over-https-tangerine#1

@titanism
Copy link
Author

@Kikobeats will follow up soon - also we'll add support for other HTTP libraries - make sure to watch that repo for updates

@titanism
Copy link
Author

titanism commented Feb 25, 2023

v1.1.0 of tangerine now released with support for custom HTTP libraries, we're adding docs for other stuff soon

@Kikobeats here's an example of using got - but any other library should work using standard (url, options) approach - see new README options updated too in the docs of Tangerine to ensure you set this up accurately.

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

No branches or pull requests

2 participants