⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.dns-get-record.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
📖 第 1 页 / 共 2 页
字号:
        <i>refresh</i>: Refresh interval (seconds) secondary name        servers should use when updating remote copies of this domain.        <i>retry</i>: Length of time (seconds) to wait after a        failed refresh before making a second attempt.        <i>expire</i>: Maximum length of time (seconds) a secondary        DNS server should retain remote copies of the zone data without a        successful refresh before discarding.        <i>minimum-ttl</i>: Minimum length of time (seconds) a        client can continue to use a DNS resolution before it should request        a new resolution from the server.  Can be overridden by individual        resource records.       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left"><i>AAAA</i></td>       <td colspan="1" rowspan="1" align="left">        <i>ipv6</i>: IPv6 address       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left"><i>A6</i>(PHP &gt;= 5.1.0)</td>       <td colspan="1" rowspan="1" align="left">        <i>masklen</i>: Length (in bits) to inherit from the target        specified by <i><tt class="parameter">chain</tt></i>.        <i>ipv6</i>: Address for this specific record to merge with        <i><tt class="parameter">chain</tt></i>.        <i>chain</i>: Parent record to merge with        <i><tt class="parameter">ipv6</tt></i> data.       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left"><i>SRV</i></td>       <td colspan="1" rowspan="1" align="left">        <i>pri</i>: (Priority) lowest priorities should be used first.        <i>weight</i>: Ranking to weight which of commonly prioritized        <i><tt class="parameter">targets</tt></i> should be chosen at random.        <i>target</i> and <i>port</i>: hostname and port        where the requested service can be found.        For additional information see: <a href="http://www.faqs.org/rfcs/rfc2782" class="link external">&raquo; RFC 2782</a>       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left"><i>NAPTR</i></td>       <td colspan="1" rowspan="1" align="left">        <i>order</i> and <i>pref</i>: Equivalent to        <i><tt class="parameter">pri</tt></i> and <i><tt class="parameter">weight</tt></i> above.        <i>flags</i>, <i>services</i>, <i>regex</i>,        and <i>replacement</i>: Parameters as defined by        <a href="http://www.faqs.org/rfcs/rfc2915" class="link external">&raquo; RFC 2915</a>.       </td>      </tr>     </tbody>    </colgroup>   </table>  </p> </div> <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example">    <p><b>Example #1 Using <b>dns_get_record()</b></b></p>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">dns_get_record</span><span style="color: #007700">(</span><span style="color: #DD0000">"php.net"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>    <div class="example-contents"><p>The above example will output something similar to:</p></div>    <div class="example-contents"><pre><div class="cdata"><pre>Array(    [0] =&gt; Array        (            [host] =&gt; php.net            [type] =&gt; MX            [pri] =&gt; 5            [target] =&gt; pair2.php.net            [class] =&gt; IN            [ttl] =&gt; 6765        )    [1] =&gt; Array        (            [host] =&gt; php.net            [type] =&gt; A            [ip] =&gt; 64.246.30.37            [class] =&gt; IN            [ttl] =&gt; 8125        ))</pre></div>    </pre></div>   </div>   <div class="example">    <p><b>Example #2 Using <b>dns_get_record()</b> and DNS_ANY</b></p>    <div class="example-contents"><p>     Since it&#039;s very common to want the IP address of a mail server     once the MX record has been resolved, <b>dns_get_record()</b>     also returns an array in <i><tt class="parameter">addtl</tt></i> which     contains associate records.  <i><tt class="parameter">authns</tt></i>     is returned as well containing a list of authoritative name     servers.    </p></div>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Request&nbsp;"ANY"&nbsp;record&nbsp;for&nbsp;php.net,<br />&nbsp;&nbsp;&nbsp;and&nbsp;create&nbsp;$authns&nbsp;and&nbsp;$addtl&nbsp;arrays<br />&nbsp;&nbsp;&nbsp;containing&nbsp;list&nbsp;of&nbsp;name&nbsp;servers&nbsp;and<br />&nbsp;&nbsp;&nbsp;any&nbsp;additional&nbsp;records&nbsp;which&nbsp;go&nbsp;with<br />&nbsp;&nbsp;&nbsp;them&nbsp;*/<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">dns_get_record</span><span style="color: #007700">(</span><span style="color: #DD0000">"php.net"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">DNS_ANY</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$authns</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$addtl</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">"Result&nbsp;=&nbsp;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">"Auth&nbsp;NS&nbsp;=&nbsp;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$authns</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">"Additional&nbsp;=&nbsp;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$addtl</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>    <div class="example-contents"><p>The above example will output something similar to:</p></div>    <div class="example-contents"><pre><div class="cdata"><pre>Result = Array(    [0] =&gt; Array        (            [host] =&gt; php.net            [type] =&gt; MX            [pri] =&gt; 5            [target] =&gt; pair2.php.net            [class] =&gt; IN            [ttl] =&gt; 6765        )    [1] =&gt; Array        (            [host] =&gt; php.net            [type] =&gt; A            [ip] =&gt; 64.246.30.37            [class] =&gt; IN            [ttl] =&gt; 8125        ))Auth NS = Array(    [0] =&gt; Array        (            [host] =&gt; php.net            [type] =&gt; NS            [target] =&gt; remote1.easydns.com            [class] =&gt; IN            [ttl] =&gt; 10722        )    [1] =&gt; Array        (            [host] =&gt; php.net            [type] =&gt; NS            [target] =&gt; remote2.easydns.com            [class] =&gt; IN            [ttl] =&gt; 10722        )    [2] =&gt; Array        (            [host] =&gt; php.net            [type] =&gt; NS            [target] =&gt; ns1.easydns.com            [class] =&gt; IN            [ttl] =&gt; 10722        )    [3] =&gt; Array        (            [host] =&gt; php.net            [type] =&gt; NS            [target] =&gt; ns2.easydns.com            [class] =&gt; IN            [ttl] =&gt; 10722        ))Additional = Array(    [0] =&gt; Array        (            [host] =&gt; pair2.php.net            [type] =&gt; A            [ip] =&gt; 216.92.131.5            [class] =&gt; IN            [ttl] =&gt; 6766        )    [1] =&gt; Array        (            [host] =&gt; remote1.easydns.com            [type] =&gt; A            [ip] =&gt; 64.39.29.212            [class] =&gt; IN            [ttl] =&gt; 100384        )    [2] =&gt; Array        (            [host] =&gt; remote2.easydns.com            [type] =&gt; A            [ip] =&gt; 212.100.224.80            [class] =&gt; IN            [ttl] =&gt; 81241        )    [3] =&gt; Array        (            [host] =&gt; ns1.easydns.com            [type] =&gt; A            [ip] =&gt; 216.220.40.243            [class] =&gt; IN            [ttl] =&gt; 81241        )    [4] =&gt; Array        (            [host] =&gt; ns2.easydns.com            [type] =&gt; A            [ip] =&gt; 216.220.40.244            [class] =&gt; IN            [ttl] =&gt; 81241        ))</pre></div>    </pre></div>   </div>  </p> </div> <div class="refsect1 notes">  <h3 class="title">Notes</h3>  <blockquote><p><b class="note">Note</b>:        This function is not implemented on Windows platforms, nor does it    (currently) work on *BSD systems (including Mac). Try the    <a href="http://pear.php.net/" class="link external">&raquo; PEAR</a> class    <a href="http://pear.php.net/package/Net_DNS" class="link external">&raquo; Net_DNS</a>.   <br />  </p></blockquote> </div> <div class="refsect1 seealso">  <h3 class="title">See Also</h3>  <p class="para">   <ul class="simplelist">    <li class="member"><a href="function.dns-get-mx.html" class="function" rel="rdfs-seeAlso">dns_get_mx()</a></li>    <li class="member"><a href="function.dns-check-record.html" class="function" rel="rdfs-seeAlso">dns_check_record()</a></li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.dns-get-mx.html">dns_get_mx</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.fsockopen.html">fsockopen</a></div> <div class="up"><a href="ref.network.html">Network Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -