Función PHP dns_get_record()
Ejemplo
Obtiene los registros de recursos MX asociados con "www.w3schools.com":
<?php
print_r(dns_get_record("w3schools.com", DNS_MX));
?>
Definición y uso
La función dns_get_record() obtiene los registros de recursos DNS asociados con el nombre de host especificado.
Sintaxis
dns_get_record(hostname, type, authns, addtl, raw)
Valores paramétricos
Parameter | Description |
---|---|
hostname | Required. Specifies a hostname (like "www.w3schools.com") |
type | Optional. Specifies the resource record type to search for. Can be one of the following:
|
authns | Optional. Passed by reference and, if set, it will be populated with Resource Records for the Authoritative Name Servers |
addtl | Optional. Passed by reference and, if set, it will be populated with any Additional Records |
raw | Optional. A Boolean value. If set to TRUE, it queries only the requested type instead of looping type-by-type before getting the info stuff. Default is FALSE |
Detalles técnicos
Valor devuelto: |
Una matriz de matrices asociativas, FALSO en caso de falla. Cada matriz contiene las siguientes claves (como mínimo):
Otras claves en las matrices dependen del parámetro de tipo . |
---|---|
Versión PHP: | 5.0+ |
Registro de cambios de PHP: | PHP 7.0.16: Se agregó soporte para el tipo DNS_CAA . PHP 5.4: Se agregó el parámetro sin procesar . PHP 5.3: Disponible en plataformas Windows. |
❮ Referencia de la red PHP