← 返回命令列表

Linux command

dig 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Query

dig [example.com]

Specific

dig [example.com] [A]

Short

dig [example.com] +short

Reverse

dig -x [8.8.8.8]

Query

dig [@8.8.8.8] [example.com]

说明

dig (Domain Information Groper) is a DNS lookup utility. It queries DNS servers for various record types, provides detailed responses, and is the preferred tool for DNS troubleshooting and analysis. The command has largely replaced older tools like nslookup.

参数

@_server_
Query specific DNS server
+short
Brief output (just answer)
+noall +answer
Show only answer section
-x _ip_
Reverse lookup
-t _type_
Record type (A, AAAA, MX, NS, etc.)
+trace
Trace DNS delegation path
+dnssec
Request DNSSEC records
-4 / -6
Use IPv4 / IPv6 only

FAQ

What is the dig command used for?

dig (Domain Information Groper) is a DNS lookup utility. It queries DNS servers for various record types, provides detailed responses, and is the preferred tool for DNS troubleshooting and analysis. The command has largely replaced older tools like nslookup.

How do I run a basic dig example?

Run `dig [example.com]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does @_server_ do in dig?

Query specific DNS server