ubuntu12.04 不能ping通dns

为当前最终发行版之前的所有版本提供支持
回复
头像
widon1104
帖子: 783
注册时间: 2008-07-17 10:55
送出感谢: 0
接收感谢: 2 次

ubuntu12.04 不能ping通dns

#1

帖子 widon1104 » 2013-04-01 18:32

想在公司电脑上装一个双系统,可是ubuntu下能ping通网关,但是ping不通dns...

widon@ubuntu:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.17.83.254 0.0.0.0 UG 100 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
172.17.83.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
widon@ubuntu:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:24:81:8b:10:4b
inet addr:172.17.83.143 Bcast:172.17.83.255 Mask:255.255.255.0
inet6 addr: fe80::224:81ff:fe8b:104b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:384 errors:0 dropped:9 overruns:0 frame:0
TX packets:477 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:41855 (41.8 KB) TX bytes:51299 (51.2 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
widon@ubuntu:~$ ping 10.3.4.24
PING 10.3.4.24 (10.3.4.24) 56(84) bytes of data.
^C
--- 10.3.4.24 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1007ms

widon@ubuntu:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.3.4.24
nameserver 10.3.8.1

widon@ubuntu:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 172.17.83.143
gateway 172.17.83.254
netmask 255.255.255.0
#network 172.17.83.0
#broadcast 172.17.83.255
#dns-nameservers 10.3.4.24 10.3.8.1

#auto eth0
#iface eth0 inet dhcp

widon@ubuntu:~$ ping 172.17.83.254
PING 172.17.83.254 (172.17.83.254) 56(84) bytes of data.
64 bytes from 172.17.83.254: icmp_req=1 ttl=64 time=2.10 ms
64 bytes from 172.17.83.254: icmp_req=2 ttl=64 time=1.85 ms
64 bytes from 172.17.83.254: icmp_req=3 ttl=64 time=1.88 ms
^C
--- 172.17.83.254 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.855/1.948/2.108/0.119 ms
qq2501
帖子: 2
注册时间: 2011-03-28 1:50
送出感谢: 0
接收感谢: 0

Re: ubuntu12.04 不能ping通dns

#2

帖子 qq2501 » 2013-04-01 19:05

先试一下 netstat -nr 查看路由表

然后再跟踪一下tracerouter
buzzerrookie
帖子: 116
注册时间: 2012-08-21 18:17
送出感谢: 0
接收感谢: 8 次

Re: ubuntu12.04 不能ping通dns

#3

帖子 buzzerrookie » 2013-04-01 19:18

172.17.83.254是网关,10.3.4.24是DNS?
能看看网关的路由表吗?
我是一个程序员。
头像
widon1104
帖子: 783
注册时间: 2008-07-17 10:55
送出感谢: 0
接收感谢: 2 次

Re: ubuntu12.04 不能ping通dns

#4

帖子 widon1104 » 2013-04-02 15:31

ok了是arp欺骗
在windows下arp -a查看网关ip mac地址,记录下来
然后在linux下

代码: 全选

arp -s gateway-ip mac
就ok了
可以把这个命令写到/etc/rc.local里面
回复

回到 “老旧版本支持”