DNS protocol implementation using fathom sockets.
NOTE, for regular IP lookups the system.resolve* methods are preferred.
This implementation is basic and should be used for troubleshooting
only.
Methods
(static) close(callback, id)
Cleanup and close any pending lookups.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | The return callback. Returns an object with error field in case of failure. |
id |
integer | The DNS object id returned from the 'create' API. |
(static) create(callback, server, proto, port)
This function creates a DNS object.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | The return callback. Returns the object id or an object with error field in case of failure. |
server |
string | This is the IP for the DNS resolver. |
proto |
string | Indicates the protocol to be used for communication with the resolver, i.e., either 'udp' or 'tcp' (optional). |
port |
integer | This the port to be used on the resolver (optional). |
(static) lookup(callback, id, host, timeout)
Lookup the given dns name using Fathom DNS implementation..
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | Fathom invokes this callback upon arrival of the DNS response. If successful, the callback receives a dictionary whose members convey the DNS response. |
id |
integer | The DNS object id returned from the 'create' API. |
host |
string | The hostname. |
timeout |
integer | The time to wait for a response (seconds). |