PHP dns_get_record() 함수
예시
"www.w3schools.com"과 연결된 MX 리소스 레코드를 가져옵니다.
<?php
print_r(dns_get_record("w3schools.com", DNS_MX));
?>
정의 및 사용
dns_get_record() 함수는 지정된 호스트 이름과 연결된 DNS 리소스 레코드를 가져옵니다.
통사론
dns_get_record(hostname, type, authns, addtl, raw)
매개변수 값
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 |
기술적 세부 사항
반환 값: |
연관 배열의 배열, 실패 시 FALSE. 각 어레이에는 다음 키가 포함됩니다(최소한).
배열의 다른 키는 유형 매개변수 에 따라 다릅니다 . |
---|---|
PHP 버전: | 5.0+ |
PHP 변경 로그: | PHP 7.0.16: DNS_CAA 유형 에 대한 지원이 추가되었습니다 . PHP 5.4: 원시 매개변수를 추가했습니다. PHP 5.3: Windows 플랫폼에서 사용 가능합니다. |
❮ PHP 네트워크 참조