共计 2282 个字符,预计需要花费 6 分钟才能阅读完成。
举荐浏览: 每天学一个 Linux 命令(68):lsof
命令简介
nslookup(name server lookup)命令用于查问域名 DNS 信息的工具。nslookup 有两种工作模式,即“交互模式”和“非交互模式”。
[root@CentOS7-1 ~]# nslookup
-bash: nslookup: command not found
[root@CentOS7-1 ~]# yum install -y bind-utils
语法格局
nslookup [-option] [name | -] [server]
选项阐明
-query=TYPE #设置查问类型
-timeout=NUMBER #设置期待响应的超时工夫,单位秒
-sil #不显示任何正告信息。
还有一些交互的命令,有趣味的读者能够查看帮忙信息浏览。
利用举例
实例
非交互式模式
[root@CentOS7-1 ~]# nslookup www.baidu.com
Server: 223.5.5.5
Address: 223.5.5.5#53
Non-authoritative answer:
www.baidu.com canonical name = www.a.shifen.com.
Name: www.a.shifen.com
Address: 36.152.44.96
Name: www.a.shifen.com
Address: 36.152.44.95
#交互式模式
[root@CentOS7-1 ~]# nslookup
> baidu.com
Server: 223.5.5.5
Address: 223.5.5.5#53
Non-authoritative answer:
Name: baidu.com
Address: 39.156.69.79
Name: baidu.com
Address: 220.181.38.148
> 163.com
Server: 223.5.5.5
Address: 223.5.5.5#53
Non-authoritative answer:
Name: 163.com
Address: 123.58.180.7
Name: 163.com
Address: 123.58.180.8
google.com 相干的信息
# 在您的 DNS 中查问与域名 google.com 相干的所有可用信息。[root@CentOS7-1 ~]# nslookup -type=any google.com
Server: 223.5.5.5
Address: 223.5.5.5#53
Non-authoritative answer:
Name: google.com
Address: 93.46.8.90
google.com nameserver = ns1.google.com.
google.com nameserver = ns2.google.com.
google.com nameserver = ns4.google.com.
google.com nameserver = ns3.google.com.
Authoritative answers can be found from:
#在您的 DNS 中查问与域名 google.com 相干邮件替换服务器的信息
[root@CentOS7-1 ~]# nslookup -type=mx google.com
Server: 223.5.5.5
Address: 223.5.5.5#53
Non-authoritative answer:
google.com mail exchanger = 10 aspmx.l.google.com.
google.com mail exchanger = 50 alt4.aspmx.l.google.com.
google.com mail exchanger = 20 alt1.aspmx.l.google.com.
google.com mail exchanger = 30 alt2.aspmx.l.google.com.
google.com mail exchanger = 40 alt3.aspmx.l.google.com.
Authoritative answers can be found from:
反向查找一个地址 (文中地址作了解决哈)
[root@CentOS7-1 ~]# nslookup 200.208.150.3
Server: 103.240.22.111
Address: 103.240.22.111#53
Non-authoritative answer:
3.150.208.200.in-addr.arpa name = 200.208.150.3.xmission.com.
Authoritative answers can be found from:
150.208.200.in-addr.arpa nameserver = ns1.xmission.com.
150.208.200.in-addr.arpa nameserver = ns2.xmission.com.
150.208.200.in-addr.arpa nameserver = ns.xmission.com.
每天学一个 Linux 命令(66):ss
每天学一个 Linux 命令(67):nmap
正文完