找回密码
 FreeOZ用户注册
查看: 2526|回复: 1
打印 上一主题 下一主题

[Linux] linux下能ping ip不能ping域名的解决办法与原因

[复制链接]
跳转到指定楼层
1#
发表于 8-2-2012 13:09:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?FreeOZ用户注册

x
linux下能ping ip不能ping域名的解决办法与原因
竟然无法ping 域名 本想同步nrpe时间的
今天在开发的同事来说,内网不能通过域名访问自己的服务器!然后做了下面的测试发现这样的问题:
[root@Aaronwang ~]# ping www.baidu.com
ping: unknown host www.baidu.com
[root@Aaronwang ~]#ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.537 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.430 ms
— 192.168.1.1 ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.430/0.483/0.537/0.057 ms
[root@Aaronwang ~]#cat /etc/host.conf
order bind,hosts
原因及解决办法如下:
[root@Aaronwang ~]# grep host /etc/nsswitch.conf
#hosts: db files nisplus nis dns
hosts:            files
主机只找文件不走dns,将其该成hosts:      files   dns   即可
》》http://www.028nz.com/?p=38
回复  

使用道具 举报

2#
发表于 8-2-2012 14:50:53 | 只看该作者
mark
回复  

使用道具 举报

您需要登录后才可以回帖 登录 | FreeOZ用户注册

本版积分规则

小黑屋|手机版|Archiver|FreeOZ论坛

GMT+10, 26-4-2024 05:53 , Processed in 0.016138 second(s), 17 queries , Gzip On, Redis On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表