CentOS 查询 DNS 命令

有以下三种方法可以查询 DNS 服务器地址

  • cat /etc/resolv.conf
  • dig | grep SERVER
  • nslookup www.baidu.com
# 要安装 bind-utils 才能使用 dig 和 nsloopup 命令
[root@master-node ~]# yum install bind-utils
......
[root@master-node ~]# cat /etc/resolv.conf 
options timeout:2 attempts:3 rotate single-request-reopen
; generated by /usr/sbin/dhclient-script
nameserver 100.100.2.136
nameserver 100.100.2.138
[root@master-node ~]# 
[root@master-node ~]# dig | grep SERVER
;; SERVER: 100.100.2.136#53(100.100.2.136)
[root@master-node ~]# 
[root@master-node ~]# nslookup www.baidu.com
Server:         100.100.2.136
Address:        100.100.2.136#53

Non-authoritative answer:
www.baidu.com   canonical name = www.a.shifen.com.
www.a.shifen.com        canonical name = www.wshifen.com.
Name:   www.wshifen.com
Address: 103.235.46.39

你可能感兴趣的:(CentOS 查询 DNS 命令)