温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

使用linux的nslookup命令域名查询

发布时间:2020-07-11 11:30:23 来源:亿速云 阅读:157 作者:清晨 栏目:服务器

小编给大家分享一下使用linux的nslookup命令域名查询,希望大家阅读完这篇文章后大所收获,下面让我们一起去探讨吧!

nslookup命令的英文全称为 “query Internet name server interactively ”。nslookup命令主要用来查询域名的DNS信息。在使用nslookup之前,先确保已经安装了它,nslookup属于bind-utils包下一个命令 。

nslookup有两种工作模式:“交互模式”和“非交互模式”。在命令行中直接输入nslookup,无需输入任何参数即进入交互模式,由“>”提示。

语法格式:nslookup [参数] [域名]

常用参数:

-sil不显示任何警告信息
exit退出命令
server指定解析域名的服务器地址
set type=soa设置查询域名授权起始信息
set type=a设置查询域名A记录
set type=mx设置查询域名邮件交换记录

参考实例:

在非交互模式下查询域名基本信息:

[root@linuxcool ~]# nslookup linuxcool.com
Server:         180.76.76.76
Address:        180.76.76.76#53
Non-authoritative answer:
Name:    linuxcool.com 
Address: 216.218.186.2
Name:    linuxcool.com
Address: 2001:470:0:76::2

进入交互模式下查询域名信息:

[root@linuxcool ~]# nslookup
>linuxcool.com
Server:         180.76.76.76
Address:        180.76.76.76#53 

Non-authoritative answer:
Name:   linuxcool.com
Address: 216.218.186.2
Name:   linuxcool.com
Address: 2001:470:0:76::2
>

在交互模式下使用“set”选项设置域名查询类型进行查询:

[root@linuxcool ~]# nslookup
>set type=mx     
>linuxcool.com
Server:         180.76.76.76
Address:        180.76.76.76#53 

Non-authoritative answer:
linuxcool.com  mail exchanger = 1 linuxcool.com.

Authoritative answers can be found from:
linuxcool.com  internet address = 216.218.186.2
linuxcool.com  has AAAA address 2001:470:0:76::2

看完了这篇文章,相信你对使用linux的nslookup命令域名查询有了一定的了解,想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI