PHP dns_get_record() Functie
Voorbeeld
Haalt de MX-bronrecords op die zijn gekoppeld aan "www.w3schools.com":
<?php
print_r(dns_get_record("w3schools.com", DNS_MX));
?>
Definitie en gebruik
De functie dns_get_record() haalt de DNS-bronrecords op die zijn gekoppeld aan de opgegeven hostnaam.
Syntaxis
dns_get_record(hostname, type, authns, addtl, raw)
Parameterwaarden
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 |
Technische details
Winstwaarde: |
Een array van associatieve arrays, ONWAAR bij fout. Elke array bevat de volgende sleutels (minimaal):
Andere sleutels in de arrays zijn afhankelijk van de typeparameter . |
---|---|
PHP-versie: | 5.0+ |
PHP-wijzigingslogboek: | PHP 7.0.16: Ondersteuning toegevoegd voor DNS_CAA type . PHP 5.4: de onbewerkte parameter toegevoegd. PHP 5.3: beschikbaar op Windows-platforms. |
❮ PHP-netwerkreferentie