这是我得到的

这是我得到的

我有一台装有 CentOS 6、WHM 的专用服务器。服务器响应速度极慢。资源使用率不到 10%。在尝试排除故障时,我发现无法使用 ping 命令

这是我得到的

root@power [/tmp]# curl -v google.com
* getaddrinfo(3) failed for google.com:80
* Couldn't resolve host 'google.com'
* Closing connection #0
curl: (6) Couldn't resolve host 'google.com'

=========== 这是顶部输出

top - 13:38:42 up 3 days,  7:51,  1 user,  load average: 0.27, 0.26, 0.25 
Tasks: 264 total,   1 running, 261 sleeping,   0 stopped,   2 zombie 
Cpu(s):  1.5%us,  0.2%sy,  0.0%ni, 97.8%id,  0.3%wa,  0.0%hi, 0.1%si,  0.0%st 
Mem:  32837836k total, 26601760k used,  6236076k free,   238304k buffers 
Swap: 16515068k total,    15664k used, 16499404k free, 23405328k cached

有什么帮助吗?提前为我的糟糕英语道歉

编辑:添加了这些输出这是 resolv.conf 文件

search com
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 208.67.222.222

root@power [/tmp]# ping www.google.com
ping: unknown host www.google.com

root@power [/tmp]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
64 bytes from 8.8.8.8: icmp_seq=5 ttl=59 time=0.734 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=59 time=0.719 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=59 time=0.606 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=59 time=0.686 ms
64 bytes from 8.8.8.8: icmp_seq=9 ttl=59 time=0.661 ms
64 bytes from 8.8.8.8: icmp_seq=10 ttl=59 time=0.665 ms


root@power [/tmp]# nslookup www.google.com
Server:         208.67.222.222
Address:        208.67.222.222#53

Non-authoritative answer:
Name:   www.google.com
Address: 74.125.227.243
Name:   www.google.com
Address: 74.125.227.240
Name:   www.google.com
Address: 74.125.227.244
Name:   www.google.com
Address: 74.125.227.242
Name:   www.google.com
Address: 74.125.227.241


root@power [/tmp]# dig @8.8.8.8 www.google.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.37.rc1.el6_7.2 <<>> @8.8.8.8 www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29195
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.google.com.                        IN      A

;; ANSWER SECTION:
www.google.com.         299     IN      A       74.125.227.244
www.google.com.         299     IN      A       74.125.227.241
www.google.com.         299     IN      A       74.125.227.243
www.google.com.         299     IN      A       74.125.227.240
www.google.com.         299     IN      A       74.125.227.242

;; Query time: 26 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sun Aug  9 14:54:35 2015
;; MSG SIZE  rcvd: 112

答案1

听起来像是 DNS 问题。验证/etc/resolv.conf配置是否正确。验证您是否能够访问您定义的名称服务器(使用nslookupping)。

另外,请确保您能够访问互联网。您可以 ping 其中一个 Google DNS 服务器来验证:

ping 8.8.8.8

相关内容