PHP dns_get_record() Funzione
Esempio
Ottiene i record delle risorse MX associati a "www.w3schools.com":
<?php
print_r(dns_get_record("w3schools.com", DNS_MX));
?>
Definizione e utilizzo
La funzione dns_get_record() ottiene i record di risorse DNS associati al nome host specificato.
Sintassi
dns_get_record(hostname, type, authns, addtl, raw)
Valori dei parametri
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 |
Dettagli tecnici
Valore di ritorno: |
Un array di array associativi, FALSE in caso di errore. Ogni array contiene le seguenti chiavi (almeno):
Altre chiavi negli array dipendono dal parametro type . |
---|---|
Versione PHP: | 5.0+ |
Registro delle modifiche PHP: | PHP 7.0.16: Aggiunto supporto per il tipo DNS_CAA . PHP 5.4: Aggiunto il parametro grezzo . PHP 5.3: disponibile su piattaforme Windows. |
❮ Riferimento alla rete PHP