Could not find GetNetworkParams function.
Unsupported address family.
Illegal flags specified.
Illegal hints flags specified.
Misformatted hostname.
Misformatted DNS query.
Misformatted DNS reply.
Misformatted string.
DNS query cancelled.
Could not contact DNS servers.
Channel is being destroyed.
End of file.
Error reading file.
DNS server claims query was misformatted.
Error loading iphlpapi.dll.
DNS server returned answer with no data.
Out of memory.
Given hostname is not numeric.
Domain name not found.
DNS server does not implement requested operation.
c-ares library initialization not yet performed.
DNS server refused query.
DNS server returned general failure.
Timeout while contacting DNS servers.
Returns an array of IP address strings that are being used for name resolution.
Returns an array of IP address strings that are being used for name resolution.
Resolves a hostname (e.g.
Resolves a hostname (e.g. 'nodejs.org') into the first found A (IPv4) or AAAA (IPv6) record. options can be an object or integer. If options is not provided, then IPv4 and IPv6 addresses are both valid. If options is an integer, then it must be 4 or 6.
Alternatively, options can be an object containing these properties:
All properties are optional.
dns.lookup(hostname[, options], callback)
Resolves a hostname (e.g.
Resolves a hostname (e.g. 'nodejs.org') into the first found A (IPv4) or AAAA (IPv6) record. options can be an object or integer. If options is not provided, then IPv4 and IPv6 addresses are both valid. If options is an integer, then it must be 4 or 6.
Alternatively, options can be an object containing these properties:
All properties are optional.
dns.lookup(hostname[, options], callback)
Resolves the given address and port into a hostname and service using the operating system's underlying getnameinfo implementation.
Resolves the given address and port into a hostname and service using the operating system's underlying getnameinfo implementation.
If address is not a valid IP address, a TypeError will be thrown. The port will be coerced to a number. If it is not a legal port, a TypeError will be thrown.
The callback has arguments (err, hostname, service). The hostname and service arguments are strings (e.g. 'localhost' and 'http' respectively).
On error, err is an Error object, where err.code is the error code.
dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { ... })
dns.lookupService(address, port, callback)
Uses the DNS protocol to resolve a hostname (e.g.
Uses the DNS protocol to resolve a hostname (e.g. 'nodejs.org') into an array of the record types specified by rrtype. On error, err is an Error object, where err.code is one of the error codes listed here.
the hostname
the callback function has arguments (err, addresses). When successful, addresses will be an array. The type of each item in addresses is determined by the record type, and described in the documentation for the corresponding lookup methods.
dns.resolve(hostname[, rrtype], callback)
Uses the DNS protocol to resolve a hostname (e.g.
Uses the DNS protocol to resolve a hostname (e.g. 'nodejs.org') into an array of the record types specified by rrtype. On error, err is an Error object, where err.code is one of the error codes listed here.
the hostname
the given rrtype Valid values for rrtype are: 'A' - IPV4 addresses, default 'AAAA' - IPV6 addresses 'MX' - mail exchange records 'TXT' - text records 'SRV' - SRV records 'PTR' - PTR records 'NS' - name server records 'CNAME' - canonical name records 'SOA' - start of authority record 'NAPTR' - name authority pointer record
the callback function has arguments (err, addresses). When successful, addresses will be an array. The type of each item in addresses is determined by the record type, and described in the documentation for the corresponding lookup methods.
dns.resolve(hostname[, rrtype], callback)
Uses the DNS protocol to resolve a IPv4 addresses (A records) for the hostname.
Uses the DNS protocol to resolve a IPv4 addresses (A records) for the hostname. The addresses argument passed to the callback function will contain an array of IPv4 addresses (e.g. ['74.125.79.104', '74.125.79.105', '74.125.79.106']).
dns.resolve4(hostname, callback)
Uses the DNS protocol to resolve a IPv6 addresses (AAAA records) for the hostname.
Uses the DNS protocol to resolve a IPv6 addresses (AAAA records) for the hostname. The addresses argument passed to the callback function will contain an array of IPv6 addresses.
dns.resolve6(hostname, callback)
Uses the DNS protocol to resolve CNAME records for the hostname.
Uses the DNS protocol to resolve CNAME records for the hostname. The addresses argument passed to the callback function will contain an array of canonical name records available for the hostname (e.g. ['bar.example.com']).
dns.resolveCname(hostname, callback)
Uses the DNS protocol to resolve mail exchange records (MX records) for the hostname.
Uses the DNS protocol to resolve mail exchange records (MX records) for the hostname. The addresses argument passed to the callback function will contain an array of objects containing both a priority and exchange property (e.g. [{priority: 10, exchange: 'mx.example.com'}, ...]).
dns.resolveMx(hostname, callback)
Uses the DNS protocol to resolve regular expression based records (NAPTR records) for the hostname.
Uses the DNS protocol to resolve regular expression based records (NAPTR records) for the hostname. The callback function has arguments (err, addresses). The addresses argument passed to the callback function will contain an array of objects with the following properties:
dns.resolveNaptr(hostname, callback)
Uses the DNS protocol to resolve name server records (NS records) for the hostname.
Uses the DNS protocol to resolve name server records (NS records) for the hostname. The addresses argument passed to the callback function will contain an array of name server records available for hostname (e.g., ['ns1.example.com', 'ns2.example.com']).
dns.resolveNs(hostname, callback)
Uses the DNS protocol to resolve pointer records (PTR records) for the hostname.
Uses the DNS protocol to resolve pointer records (PTR records) for the hostname. The addresses argument passed to the callback function will be an array of strings containing the reply records.
dns.resolvePtr(hostname, callback)
Uses the DNS protocol to resolve a start of authority record (SOA record) for the hostname.
Uses the DNS protocol to resolve a start of authority record (SOA record) for the hostname. The addresses argument passed to the callback function will be an object with the following properties:
dns.resolveSoa(hostname, callback)
Uses the DNS protocol to resolve service records (SRV records) for the hostname.
Uses the DNS protocol to resolve service records (SRV records) for the hostname. The addresses argument passed to the callback function will be an array of objects with the following properties:
dns.resolveSrv(hostname, callback)
Uses the DNS protocol to resolve text queries (TXT records) for the hostname.
Uses the DNS protocol to resolve text queries (TXT records) for the hostname. The addresses argument passed to the callback function is is a two-dimentional array of the text records available for hostname (e.g., [ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]). Each sub-array contains TXT chunks of one record. Depending on the use case, these could be either joined together or treated separately.
dns.resolveTxt(hostname, callback)
Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an array of hostnames.
Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an array of hostnames. The callback function has arguments (err, hostnames), where hostnames is an array of resolved hostnames for the given ip. On error, err is an Error object, where err.code is one of the DNS error codes.
dns.reverse(ip, callback)
Sets the IP addresses of the servers to be used when resolving.
Sets the IP addresses of the servers to be used when resolving. The servers argument is an array of IPv4 or IPv6 addresses. If a port specified on the address it will be removed. An error will be thrown if an invalid address is provided. The dns.setServers() method must not be called while a DNS query is in progress.
dns.setServers(servers)
DNS Singleton