"DNS in 04-linux (i)"
VI. testing domain name resolution on Linux
1. First check that DNS is set correctly
cat /etc/resolv.conf
[resolv.conf]# Generated by NetworkManagernameserver 192.168.80.100
2, use Nslookup to test the domain name resolution
A. General analytical method
nslookup wwww.zhangyujia.cn-----Server: 192.168.80.100Address: 192.168.80.100#53
B. Using the specified DNS resolution
nslookup www.zhangyujia.cn 114.114.114.114 #后边接上指定的DNS-----Server: 114.114.114.114Address: 114.114.114.114#53Non-authoritative answer: #非权威应答,解析的是互联网上的主机Name: www.zhangyujia.cnAddress: xxx.xxx.xxx.xxx
C. Interactive test domain name resolution
nslookup-----> www.zhangyujia.cnServer: 192.168.80.100Address: 192.168.80.100#53Name: www.zhangyujia.cnAddress: 192.168.80.100> set type=mx #和WINDOWS一样,也可以设置解析类别> 163.com
D. exit
exit
3, the use of host to test the domain name resolution (four methods, if the Discovery command is not available, please perform the Yum install bind-utils installed domain name resolution test related tools)
host -a zhangyujia.cn. 192.168.80.100 #列出该主机的所有相关信息host -l zhangyujia.cn. 192.168.80.100 #列出该域名的所有主机记录host -i 131.107.8.222 192.168.80.100 #逆向解析host -t mx zhangyujia.cn 192.168.80.100 #指定查找类型记录类型(a ptr cname txt......)
3, use dig to test the domain name resolution
dig @192.168.80.100 www.baidu.com a #使用192.168.80.100DNS服务器解析www.baidu.com主机记录
4. Use Whois to query the domain name owner (if the command is found to be unavailable, perform the Yum install Jwhois installation of this tool)
whois baidu.com
Welcome attention
Sina Weibo: https://weibo.com/yougazhang0506
Public platform: Zhang Yujia
My site: http://www.zhangyujia.cn
51CTO Blog: http://blog.51cto.com/11099293
05-linux DNS in detail (ii)