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

Check /etc/hosts first #2

Open
NotBugger opened this issue Nov 8, 2012 · 2 comments
Open

Check /etc/hosts first #2

NotBugger opened this issue Nov 8, 2012 · 2 comments

Comments

@NotBugger
Copy link

The default (and IMHO unexpected) behavior of AnyEvent::Socket is to resolve hostnames through /etc/hosts only if the DNS lookup fails. If you think of /etc/hosts as a user-defined DNS cache, it makes sense that AnyEvent::CacheDNS should override the default behavior and first check /etc/hosts, then the cache, then a DNS lookup.

Relevant thread: http://www.mail-archive.com/anyevent@lists.schmorp.de/msg00040.html

@potyl
Copy link
Owner

potyl commented Nov 9, 2012

I agree that AnyEvent::Socket's resolution strategy is really annoying. The module behaves completely differently from all the programs that use networking because they all look into /etc/hosts. This is really nasty.

I don't think that fixing this in my module is the right thing. My module is just a DNS cache. Someone should write a real linux/unix resolver that would behave as all the other networking tools behave.

@dex4er
Copy link

dex4er commented Dec 10, 2013

Please check https://github.com/dex4er/perl-AnyEvent-DNS-EtcHosts

It modifies AnyEvent::Socket behavior and should be complementary to AnyEvent::DNS::Cache.

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

3 participants