(PECL getdns >= 0.10.0)
php_getdns_address_sync — Synchronously retrieve IP addresses given a host name.
$context
, string $name
, int $extensions
, int &$response
)This function provides an entry point into the getdns API library to synchronously retrieve IP addresses given a host name. It always returns both IPv4 and IPv6 addresses. This function will use all of the namespaces from the context.
context
The previously created DNS context that is to be used with this request.
name
The host name to resolve to an address (note that an IP address is considered invalid).
extensions
The extensions dictionary for this request; NULL or 0 (zero) if no extensions.
response
The dictionary to receive the response. The dictionary always contains at least three names: replies_full (a list containing the DNS response as binary data), replies_tree (a list containing the parsed DNS response data) and status (an int). Note that this argument is passed by reference and any existing value will be overwritten. The response must be freed using php_getdns_dict_destroy().
This function returns an integer response code. GETDNS_RETURN_GOOD indicates successful completion.