← 返回命令列表

Linux command

nslookup 命令

文本

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

常用示例

Lookup IP address

nslookup [example.com]

Lookup using specific DNS server

nslookup [example.com] [8.8.8.8]

Reverse DNS lookup

nslookup [192.168.1.1]

Query specific record type

nslookup -type=[MX] [example.com]

Query all records

nslookup -type=[ANY] [example.com]

Use TCP instead of UDP

nslookup -vc [example.com]

Interactive mode

nslookup

Debug mode

nslookup -debug [example.com]

说明

nslookup queries DNS servers for hostname and IP information. It can perform forward and reverse lookups, query specific record types, and diagnose DNS issues. The tool operates in interactive or non-interactive mode, with interactive mode allowing multiple queries.

参数

-type=_type_
Record type (A, AAAA, MX, NS, TXT, SOA, PTR, ANY, CNAME, SRV).
-query=_type_
Alias for -type.
-class=_class_
DNS class (IN, CH, HS, ANY). Default is IN.
-debug
Show debug information (full response packets).
-port=_port_
DNS server port (default 53).
-timeout=_seconds_
Query timeout.
-retry=_n_
Number of retries before giving up.
-vc
Use TCP instead of UDP for queries.
-nosearch
Do not append the search list to unqualified names.
-norecurse
Do not request recursive resolution from the server.
-version
Print version and exit.

FAQ

What is the nslookup command used for?

nslookup queries DNS servers for hostname and IP information. It can perform forward and reverse lookups, query specific record types, and diagnose DNS issues. The tool operates in interactive or non-interactive mode, with interactive mode allowing multiple queries.

How do I run a basic nslookup example?

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

What does -type=_type_ do in nslookup?

Record type (A, AAAA, MX, NS, TXT, SOA, PTR, ANY, CNAME, SRV).