<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.network.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.checkdnsrr.php',
    1 => 'checkdnsrr',
    2 => '给指定的主机（域名）或者IP地址做DNS通信检查',
  ),
  'up' => 
  array (
    0 => 'ref.network.php',
    1 => '网络 函数',
  ),
  'prev' => 
  array (
    0 => 'ref.network.php',
    1 => '网络 函数',
  ),
  'next' => 
  array (
    0 => 'function.closelog.php',
    1 => 'closelog',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/network/functions/checkdnsrr.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.checkdnsrr" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">checkdnsrr</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">checkdnsrr</span> &mdash; <span class="dc-title">给指定的主机（域名）或者IP地址做DNS通信检查</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.checkdnsrr-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>checkdnsrr</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$hostname</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$type</code><span class="initializer"> = &quot;MX&quot;</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   在 DNS 中搜索与 <code class="parameter">hostname</code> 对应的 <code class="parameter">type</code> 类型纪录。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.checkdnsrr-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">hostname</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">hostname</code> 可以是点分十进制的 IP 地址，也可以是主机名。
      </p>
     </dd>
    
    
     <dt><code class="parameter">type</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">type</code> 可能是下面这些类型中的任何一个：A、MX、NS、SOA、PTR、CNAME、AAAA、A6、SRV、NAPTR、TXT 或 ANY。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.checkdnsrr-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   如果记录能找到，就返回 <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>；如果查找不到该 DNS 记录或者发生了错误，就返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.checkdnsrr-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    出于对低版本在 Windows 平台上的兼容性，可以试试 <a href="https://pear.php.net/" class="link external">&raquo;&nbsp;PEAR</a>
    扩展包里面提供的 <a href="https://pear.php.net/package/Net_DNS" class="link external">&raquo;&nbsp;Net_DNS</a> 类。
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.checkdnsrr-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.dns-get-record.php" class="function" rel="rdfs-seeAlso">dns_get_record()</a> - 获取指定主机名的 DNS 纪录</span></li>
    <li><span class="function"><a href="function.getmxrr.php" class="function" rel="rdfs-seeAlso">getmxrr()</a> - 获取 Internet 主机名对应的 MX 记录</span></li>
    <li><span class="function"><a href="function.gethostbyaddr.php" class="function" rel="rdfs-seeAlso">gethostbyaddr()</a> - 获取指定 IP 地址对应的 Internet 主机名</span></li>
    <li><span class="function"><a href="function.gethostbyname.php" class="function" rel="rdfs-seeAlso">gethostbyname()</a> - 返回主机名对应的 IPv4地址。</span></li>
    <li><span class="function"><a href="function.gethostbynamel.php" class="function" rel="rdfs-seeAlso">gethostbynamel()</a> - 获取互联网主机名对应的 IPv4 地址列表</span></li>
    <li>the named(8) manual page</li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>