lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Apr 12, 2010, at 7:01 PM, Jon Nalley wrote:

> Keep in mind the host running the above code must be using the OpenDNS
> nameservers for DNS.  The IP's of the OpenDNS servers are:
> and

Cool :)

% dig @ A +short

Is it possible to pass the DNS server name to query to LuaSocket? Hmmm... apparently not.

dns.lua [1] to the rescue!

local dns = require( 'dns' )

dns._resolver = dns.resolver()
dns._resolver:setnameserver( '' )
print( dns.lookup( '', 'A', 'IN' ) )