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

nameserver discovery #19

Closed
DeTeam opened this issue Jan 18, 2019 · 4 comments
Closed

nameserver discovery #19

DeTeam opened this issue Jan 18, 2019 · 4 comments

Comments

@DeTeam
Copy link

DeTeam commented Jan 18, 2019

One thing that pollen could do is to find nameservers to query based on dns configuration, /etc/resolv.conf, this way one would not have to pass it manually.

Could also provide it as a utility function

@shuhei
Copy link
Owner

shuhei commented Jan 18, 2019

Oh, I thought that dns.resolve4() used nameservers in /etc/resolv.conf because the underlying c-ares seems to do so. Have you tested whether it works like that?

@shuhei
Copy link
Owner

shuhei commented Jan 18, 2019

In the worst case, we could use dns.lookup() with all: true instead of dns.resolve4() so that we can support /etc/hosts too. There will be less chance that it will block the libuv thread pool as long as we don't make too many lookups.

@DeTeam
Copy link
Author

DeTeam commented Jan 18, 2019

There will be less chance that it will block the libuv thread pool as long as we don't make too many lookups.

Btw, I was reading libuv source code the other day, dns request do not seem to block the whole pool.
Only half of uv thread pool is dedicated to slow io (dns), the rest is available for fast io (filesystem) and cpu-heavy tasks.

I thought that dns.resolve4() used nameservers in

Ah, you're right, I got confused then. Closing the ticket!

Have you tested whether it works like that?

Nope, I'm just browsing through the source atm

@DeTeam DeTeam closed this as completed Jan 18, 2019
@shuhei
Copy link
Owner

shuhei commented Jan 19, 2019

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

2 participants