nslookup
install
npm install nslookup
quick example
// default is 8.8.8.8 type'mx' // default is 'a' // default is 3 * 1000 ms ;
API
nslookup
nslookup(domain)
and chain with methods
nslookup(domain, function (err, addrs))
. Simply query a
type and use 8.8.8.8
.
.server(server)
String or Object
String: .server(8.8.8.8)
Object: .server({ address: '8.8.8.8', port: 53, type: 'udp' })
.type(type)
here can be mx
or a
or ns
e.g.: .type('ns')
.timeout(timeout)
default is 3 * 1000 ms.
if timeout, then the NSLookupTimeoutError
error would be callback.
.timeout(3 * 1000)
.end(callback)
callback = function (err, addrs)
addrs
is an Array