我有一个新的路由器,但通过它连接互联网时出现问题。我无法下载、ping 或创建 example.com nslookup
:
$ curl -vvv example.com
* Rebuilt URL to: example.com/
* Could not resolve host: example.com
* Closing connection 0
curl: (6) Could not resolve host: example.com
$ ping example.com
ping: unknown host example.com
$ traceroute example.com
example.com: Temporary failure in name resolution
Cannot handle "host" cmdline arg `example.com' on position 1 (argc 1)
$ nslookup example.com
;; connection timed out; no servers could be reached
但我有一个 IP 地址:
$ ifconfig
[...]
wlan0 Link encap:Ethernet HWaddr [snip]
inet addr:192.168.0.103 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: [snip]/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7827 errors:0 dropped:0 overruns:0 frame:0
TX packets:7854 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4282672 (4.2 MB) TX bytes:1272800 (1.2 MB)
我的路由表:
$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 600 0 0 wlan0
link-local * 255.255.0.0 U 1000 0 0 wlan0
192.168.0.0 * 255.255.255.0 U 600 0 0 wlan0
我可以从浏览器访问路由器的 Web 界面 (192.168.0.1)。我还可以 ping 外部 IP,例如example.com
== 93.184.216.34
:
$ ping 93.184.216.34
PING 93.184.216.34 (93.184.216.34) 56(84) bytes of data.
64 bytes from 93.184.216.34: icmp_seq=1 ttl=49 time=117 ms
64 bytes from 93.184.216.34: icmp_seq=2 ttl=49 time=115 ms
^C
--- 93.184.216.34 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 115.365/116.258/117.151/0.893 ms
即使使用 IP 而不是名称,也无法下载:
$ curl -vvv 93.184.216.34
* Rebuilt URL to: 93.184.216.34/
* Trying 93.184.216.34...
^C
由于 DNS 是一种使用 UDP 的协议,我无法解析地址,也无法直接连接到 IP,所以我猜我没有 UDP 或 TCP 连接,但由于某种原因,ping 探测会通过路由器。在这种情况下可能配置错误?请注意,我尝试使用其他设备(我的智能手机)连接到路由器的 wifi,但它也无法连接到互联网。