在12.10安装时无法解析dns

我对Ubuntu上的网络很陌生,所以我一直在努力解决这个问题几个小时。 我正在运行全新安装的Ubuntu 12.10,在使用无线连接时无法解析DNS。 我已经遵循了通过一些谷歌搜索找到的许多解决方案,但仍然无法使其工作。 我尝试将Google名称服务器添加到/etc/resolv.conf但这没有帮助。 我还尝试通过网络管理器添加静态名称服务器,但也不成功。 当我在命令行输入ifcongig -a时,我得到以下内容。

 eth0 Link encap:Ethernet HWaddr 00:26:2d:7f:ea:7c UP BROADCAST MULTICAST MTU:1500 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:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:16 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:247 errors:0 dropped:0 overruns:0 frame:0 TX packets:247 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:22898 (22.8 KB) TX bytes:22898 (22.8 KB) wlan0 Link encap:Ethernet HWaddr 70:1a:04:e9:3a:4b inet addr:10.0.0.28 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::721a:4ff:fee9:3a4b/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:121 errors:0 dropped:0 overruns:0 frame:0 TX packets:403 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:41374 (41.3 KB) TX bytes:38438 (38.4 KB) 

我的/etc/resolv.conf目前看起来像这样:

 nameserver 8.8.8.8 nameserver 8.8.4.4 

在做dig google.com我得到:

 ; <> DiG 9.8.1-P1 <> google.com ;; global options: +cmd ;; connection timed out; no servers could be reached 

ping -c 10 8.8.8.8 ,我得到:

 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. From 10.0.0.28 icmp_seq=1 Destination Host Unreachable From 10.0.0.28 icmp_seq=2 Destination Host Unreachable From 10.0.0.28 icmp_seq=3 Destination Host Unreachable From 10.0.0.28 icmp_seq=5 Destination Host Unreachable From 10.0.0.28 icmp_seq=6 Destination Host Unreachable From 10.0.0.28 icmp_seq=7 Destination Host Unreachable From 10.0.0.28 icmp_seq=8 Destination Host Unreachable From 10.0.0.28 icmp_seq=10 Destination Host Unreachable --- 8.8.8.8 ping statistics --- 10 packets transmitted, 0 received, +8 errors, 100% packet loss, time 8999ms pipe 4 

这是sudo route -n输出:

 Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 wlan0 10.0.0.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0 169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0 

我的traceroute -n 8.8.8.8输出:

 traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets 1 10.0.0.28 1804.234 ms !H 1804.210 ms !H 1804.199 ms !H 

我还要注意,我可以在我的其他设备上连接到无线网络,也可以在同一台机器上的Windows安装上连接。 当我通过以太网连接时,我也能够上网。

当我在Windows机器上执行ipconfig时,我得到了无线连接的这个片段:

 Wireless LAN adapter Wireless Network Connection: Connection-specific DNS Suffix . : hsd1.ma.comcast.net. Description . . . . . . . . . . . : Atheros AR5B93 Wireless Network Adapter Physical Address. . . . . . . . . : 70-1A-04-E9-3A-4B DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::b153:23b2:2384:d341%12(Preferred) IPv4 Address. . . . . . . . . . . : 10.0.0.28(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Lease Obtained. . . . . . . . . . : Thursday, May 09, 2013 1:50:10 PM Lease Expires . . . . . . . . . . : Thursday, May 16, 2013 3:39:12 PM Default Gateway . . . . . . . . . : 10.0.0.1 DHCP Server . . . . . . . . . . . : 10.0.0.1 DHCPv6 IAID . . . . . . . . . . . : 225450500 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-17-D9-81-3A-00-26-2D-7F-EA-7C DNS Servers . . . . . . . . . . . : 75.75.75.75 75.75.76.76 NetBIOS over Tcpip. . . . . . . . : Enabled 

任何帮助将不胜感激,因为这真的很令人沮丧。

您的/etc/resolv.conf显示正确。 这似乎是一个网络问题,而不是DNS问题。

尝试降低你的eth0(一些GUI网络管理员更喜欢无线的有线连接,它可能会认为你有一个奇怪的原因信号)。 将其删除的命令将是“sudo ifdown eth0”,然后尝试挖掘google.com。 或者,如果Ubuntu取消了ifdown脚本(不知道它们是否成功),你可以执行“sudo ifconfig eth0 down”。

如果你想重新启动它,只需要“sudo ifup eth0”或“sudo ifconfig eth0 up”。

您是否尝试让ubuntu自动为您管理DNS?

简而言之:使用“resolvconf”

 sudo apt-get install resolvconf sudo dpkg-reconfigure resolvconf 

参考:

在Ubuntu 12.04桌面中自动解析DNS