getdns Functions
PHP Manual


(PECL getdns >= 0.10.0)

php_getdns_convert_dns_name_to_fqdnConvert a domain name in DNS format to presentation format.


int php_getdns_convert_dns_name_to_fqdn ( string $bindata , string &$string )

This function converts a fully-qualified domain name (FQDN) in DNS format to a presentation format represented as a null-terminated character string with interior dots. Names in DNS fields are stored in a fashion very different from the normal presentation format normally used in applications. The DNS format is described in the first paragraph in Section 3.1 of » RFC 1035. This helper function only works with names in DNS format that are not compressed. It is useful for converting domain names in the replies_tree to and from the FQDN presentation format.



A bindata value that contains a FQDN in DNS format. The PHP pack() function can be used to create a string of binary data.


A string value that will contain the FQDN converted to presentation format. Note that this argument is passed by reference and any existing value will be overwritten. NULL is returned if any conversion or memory allocation errors are encountered.

Return Values

This function returns an integer response code. GETDNS_RETURN_GOOD indicates successful completion.

getdns Functions
PHP Manual