Funkce PHP dns_get_record().
Příklad
Získá záznamy prostředků MX spojené s „www.w3schools.com“:
<?php
print_r(dns_get_record("w3schools.com", DNS_MX));
?>
Definice a použití
Funkce dns_get_record() získává záznamy prostředků DNS spojené se zadaným názvem hostitele.
Syntax
dns_get_record(hostname, type, authns, addtl, raw)
Hodnoty parametrů
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 |
Technické údaje
Návratová hodnota: |
Pole asociativních polí, FALSE při selhání. Každé pole obsahuje následující klíče (minimálně):
Ostatní klíče v polích závisí na parametru typu . |
---|---|
Verze PHP: | 5,0+ |
PHP Changelog: | PHP 7.0.16: Přidána podpora pro typ DNS_CAA . PHP 5.4: Přidán parametr raw . PHP 5.3: K dispozici na platformách Windows. |
❮ PHP Network Reference