-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
It can be complex figuring out how to do a 'normal' dns query.
e.g. to lookup an ip for google.com, you currently need something like:
local dns = require "cqueues.dns"
local host = "google.com"
local res, err, errno = dns.query(host)
if not res then return nil, err, errno end
local ip
for rec in res:grep{section = "answer", type = "A", class = "IN", name = host .. "."} do
ip = rec:addr()
break
end
if ip then
return ip
else
return nil, "not found"
end
Add a simpler interface.