-bash: dig: command not found

时间:2024-10-10 07:17:24

现象

$ dig www.baidu.com
-bash: dig: command not found

解决

$ yum -y install bind-utils

验证

$ dig www.baidu.com

; <<>> DiG 9.10.6 <<>> www.baidu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63822
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4000
;; QUESTION SECTION:
;www.baidu.com.			IN	A

;; ANSWER SECTION:
www.baidu.com.		364	IN	CNAME	www.a.shifen.com.
www.a.shifen.com.	22	IN	A	220.181.38.150
www.a.shifen.com.	22	IN	A	220.181.38.149

;; Query time: 18 msec
;; SERVER: fd00:1:1010::1#53(fd00:1:1010::1)
;; WHEN: Wed Oct 09 17:24:04 CST 2024
;; MSG SIZE  rcvd: 101