在公司一台服務器上使用yum方式搭建zabbix-agent組件的時候,提示說無法解析域名地址
[root@jcsjoracle ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-1.el6.noarch.rpm Retrieving https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-1.el6.noarch.rpm curl: (6) Couldn't resolve host 'repo.zabbix.com' error: skipping https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-1.el6.noarch.rpm - transfer failed [root@jcsjoracle ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-1.el6.noarch.rpm Retrieving https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-1.el6.noarch.rpm curl: (6) Couldn't resolve host 'repo.zabbix.com' error: skipping https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-1.el6.noarch.rpm - transfer failed
使用ping方式查看域名地址會無法解析,查看具體IP地址正常
[root@jcsjoracle ~]# ping www.baidu.com ping: unknown host www.baidu.com [root@jcsjoracle ~]# ping 10.40.209.59 PING 10.40.209.59 (10.40.209.59) 56(84) bytes of data. 64 bytes from 10.40.209.59: icmp_seq=1 ttl=64 time=4.49 ms 64 bytes from 10.40.209.59: icmp_seq=2 ttl=64 time=0.910 ms ^C --- 10.40.209.59 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1926ms rtt min/avg/max/mdev = 0.910/2.700/4.491/1.791 ms
網上搜索資料發現是因為域名沒有被正常解析,需要配置DNS
[root@jcsjoracle ~]# vi /etc/resolv.conf nameserver 114.114.114.114
配置完成后,不需要重啟服務器,再次ping域名地址,提示正常,最后通過yum方式下載zabbix-agent也正常
[root@jcsjoracle ~]# ping www.baidu.com PING www.a.shifen.com (163.177.151.110) 56(84) bytes of data. 64 bytes from 163.177.151.110: icmp_seq=1 ttl=54 time=5.47 ms 64 bytes from 163.177.151.110: icmp_seq=2 ttl=54 time=3.91 ms ^C --- www.a.shifen.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1403ms rtt min/avg/max/mdev = 3.916/4.694/5.472/0.778 ms [root@jcsjoracle ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-1.el6.noarch.rpm Retrieving https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-1.el6.noarch.rpm warning: /var/tmp/rpm-tmp.VVeU80: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY Preparing... ########################################### [100%] 1:zabbix-release ########################################### [100%]