2019-04-21 11:50:48 +08:00

49 lines
2.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="dig">dig</h1>
<p>域名查询工具</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>dig命令</strong> 是常用的域名查询工具,可以用来测试域名系统工作是否正常。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">dig(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">@&lt;服务器地址&gt;:指定进行域名解析的域名服务器;
-b&lt;ip地址&gt;当主机具有多个IP地址指定使用本机的哪个IP地址向域名服务器发送域名查询请求
-f&lt;文件名称&gt;指定dig以批处理的方式运行指定的文件中保存着需要批处理查询的DNS任务信息
-P指定域名服务器所使用端口号
-t&lt;类型&gt;指定要查询的DNS数据类型
-x&lt;IP地址&gt;:执行逆向域名查询;
-4使用IPv4
-6使用IPv6
-h显示指令帮助信息。</code></pre>
<h3 id="参数">参数</h3>
<ul>
<li>主机:指定要查询域名主机;</li>
<li>查询类型指定DNS查询的类型</li>
<li>查询类指定查询DNS的class</li>
<li>查询选项:指定查询选项。</li>
</ul>
<h3 id="实例">实例</h3>
<pre><code class="language-bash">[root@localhost ~]# dig www.jsdig.com
; &lt;&lt;&gt;&gt; DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.1 &lt;&lt;&gt;&gt; www.jsdig.com
;; global options: printcmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 2115
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 0
;; QUESTION SECTION:
;www.jsdig.com. IN A
;; ANSWER SECTION:
www.jsdig.com. 0 IN CNAME host.1.jsdig.com.
host.1.jsdig.com. 0 IN A 100.42.212.8
;; AUTHORITY SECTION:
jsdig.com. 8 IN NS f1g1ns2.dnspod.net.
jsdig.com. 8 IN NS f1g1ns1.dnspod.net.
;; Query time: 0 msec
;; SERVER: 202.96.104.15#53(202.96.104.15)
;; WHEN: Thu Dec 26 11:14:37 2013
;; MSG SIZE rcvd: 121</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->