M
dns.resolve4
History
Added in: v0.1.16
v0.1.16
Introduced in: v0.10.0
v0.10.0
Passing an invalid callback to the
callback argument now throws ERR_INVALID_ARG_TYPE instead of ERR_INVALID_CALLBACK.v18.0.0
This method now supports passing
options, specifically options.ttl.v7.2.0
dns.resolve4(hostname, options?, callback): void
Attributes
Uses the DNS protocol to resolve an 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']).