-## DNS
+# DNS
Use `require('dns')` to access this module. All methods in the dns module
use C-Ares except for `dns.lookup` which uses `getaddrinfo(3)` in a thread
});
});
-### dns.lookup(domain, [family], callback)
+## dns.lookup(domain, [family], callback)
Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or
AAAA (IPv6) record.
necessarily the value initially passed to `lookup`).
-### dns.resolve(domain, [rrtype], callback)
+## dns.resolve(domain, [rrtype], callback)
Resolves a domain (e.g. `'google.com'`) into an array of the record types
specified by rrtype. Valid rrtypes are `'A'` (IPV4 addresses, default),
the error in English.
-### dns.resolve4(domain, callback)
+## dns.resolve4(domain, callback)
The same as `dns.resolve()`, but only for IPv4 queries (`A` records).
`addresses` is an array of IPv4 addresses (e.g.
`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
-### dns.resolve6(domain, callback)
+## dns.resolve6(domain, callback)
The same as `dns.resolve4()` except for IPv6 queries (an `AAAA` query).
-### dns.resolveMx(domain, callback)
+## dns.resolveMx(domain, callback)
The same as `dns.resolve()`, but only for mail exchange queries (`MX` records).
`addresses` is an array of MX records, each with a priority and an exchange
attribute (e.g. `[{'priority': 10, 'exchange': 'mx.example.com'},...]`).
-### dns.resolveTxt(domain, callback)
+## dns.resolveTxt(domain, callback)
The same as `dns.resolve()`, but only for text queries (`TXT` records).
`addresses` is an array of the text records available for `domain` (e.g.,
`['v=spf1 ip4:0.0.0.0 ~all']`).
-### dns.resolveSrv(domain, callback)
+## dns.resolveSrv(domain, callback)
The same as `dns.resolve()`, but only for service records (`SRV` records).
`addresses` is an array of the SRV records available for `domain`. Properties
of SRV records are priority, weight, port, and name (e.g.,
`[{'priority': 10, {'weight': 5, 'port': 21223, 'name': 'service.example.com'}, ...]`).
-### dns.reverse(ip, callback)
+## dns.reverse(ip, callback)
Reverse resolves an ip address to an array of domain names.
The callback has arguments `(err, domains)`.
-### dns.resolveNs(domain, callback)
+## dns.resolveNs(domain, callback)
The same as `dns.resolve()`, but only for name server records (`NS` records).
`addresses` is an array of the name server records available for `domain`
(e.g., `['ns1.example.com', 'ns2.example.com']`).
-### dns.resolveCname(domain, callback)
+## dns.resolveCname(domain, callback)
The same as `dns.resolve()`, but only for canonical name records (`CNAME`
records). `addresses` is an array of the canonical name records available for