connectFree/lev

[lev.DNS] Implement dns module using c-ares, not uv_getaddrinfo

hnakamur opened this issue · 5 comments

What APIs should we have? Are the same APIs as node.js OK?

http://nodejs.org/api/dns.html

Same API as Node.JS is fine, except we will change lookup and add a new option, lookup_family

dns.lookup(domain, callback)
dns.lookup_family(domain, family, callback)
dns.resolve(domain, [rrtype], callback)
dns.resolve4(domain, callback)
dns.resolve6(domain, callback)
dns.resolveMx(domain, callback)
dns.resolveTxt(domain, callback)
dns.resolveSrv(domain, callback)
dns.resolveNs(domain, callback)
dns.resolveCname(domain, callback)
dns.reverse(ip, callback)

Tests pass on my Ubuntu 12.04 host.
However, tests fail on my OS X Mountain Lion host.

"ENOTFOUND"
/Users/hnakamur/mysrc/lev/build/lev: tests/test-dns.lua:288: attempt to get length of local 'domains' (a nil value)
"ECONNREFUSED"
/Users/hnakamur/mysrc/lev/build/lev: tests/test-dns.lua:27: attempt to get length of local 'ips' (a nil value)

I'm trying to disable tests which fail on Travis.
Do not merge this pull request yet.

This time tests passed on Travis (skipping two tests on cname).
Please review and merge pull request #63

Thanks for merging!