您现在的位置是:网站首页> 编程资料编程资料
linux下能ping ip不能ping域名_资源网
2023-11-28
105人已围观
简介 linux下能ping ip不能ping域名_资源网
今天在开发的同事来说,内网不能通过域名访问自己的服务器!然后做了下面的测试发现这样的问题:
[root@itmop ~]# ping www.downcc.com
ping: unknown host www.downcc.com
[root@itmop ~]#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@itmop ~]#cat /etc/host.conf
order bind,hosts
经过一翻查找后解决了,原因和方法如下:
[root@itmop ~]# grep host /etc/nsswitch.conf
#hosts: db files nisplus nis dns
hosts: files
主机只找文件不走dns,将其该成hosts: files dns 即可!
相关内容
- Windows 2008R2 HyperV下安装CentOS6,网卡无痛设置_资源网
- linux 安装rpm包时遇到error:Failed dependencies解法方法_资源网
- Linux VMware中鼠标中键无法使用_资源网
- Hyper-V下的Linux虚拟机网卡丢失问题原因及解决办法_资源网
- Linux下RPM软件包的安装及卸载_资源网
- ubuntu下图形模式与linux命令行模式切换要领_资源网
- Linux系统下图形界面与Linux命令行模式切换_资源网
- Win8系统如何限制磁盘访问?_资源网
- 全民打怪兽秘术师傲雪属性技能介绍_手机游戏_游戏攻略_
- 胜利足球球员布阵攻略分享_手机游戏_游戏攻略_