![无法访问github.com](https://linux22.com/image/205240/%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AEgithub.com.png)
我无法 nslookup github:
nslookup github 8.8.8.8
;; connection timed out; no servers could be reached
nslookup github.com
;; connection timed out; no servers could be reached
注意:默认 ns 服务器 = gw = 路由器 4g = 192.168.0.1 (我猜是缓存 dns 服务器)。我在 192.168.0.0/24 上,我的 ip = 192.168.0.130,bcast = 192.168.0.255,ip 由路由器通过 dhcp 给出。
我的 nslookup 似乎正在工作:
nslookup google.com
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: google.com
Address: 142.250.187.206
Name: google.com
Address: 2a00:1450:4009:81f::200e
我可以 tlslookup github.com
tlslookup github.com
140.82.113.4
注:我不知道为什么解析可以使用此工具而不是 nslookup。我试图通过谷歌获取有关 tlslookup 的信息,但一无所获。
我用 dig 检查(以防万一我的 nslookup 不能正常工作)。不幸的是,pb 仍然保留在这个工具中。
dig github.com
; <<>> DiG 9.16.27-Debian <<>> github.com
;; global options: +cmd
;; connection timed out; no servers could be reached
dig @8.8.8.8 github.com
; <<>> DiG 9.16.27-Debian <<>> @8.8.8.8 github.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached
显然,所有依赖名称解析的命令都不起作用,但为了这篇文章,我尝试了其中的一些命令:
ping $(tlslookup github.com)
PING 140.82.114.3 (140.82.114.3) 56(84) bytes of data.
64 bytes from 140.82.114.3: icmp_seq=1 ttl=50 time=259 ms
64 bytes from 140.82.114.3: icmp_seq=2 ttl=50 time=317 ms
64 bytes from 140.82.114.3: icmp_seq=3 ttl=50 time=238 ms
^C
--- 140.82.114.3 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 237.514/271.189/316.968/33.546 ms
但
ping github.com
ping: github.com: Temporary failure in name resolution
openssl s_client -connect github.com:443
140311527400768:error:2008F002:BIO routines:BIO_lookup_ex:system lib:../crypto/bio/b_addr.c:730:Temporary failure in name resolution
connect:errno=11
wget github.com
--2022-04-28 09:52:02-- http://github.com/
Resolving github.com (github.com)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘github.com’
我尝试wget网站ip地址:
wget 140.82.113.3
--2022-04-28 10:01:13-- http://140.82.113.3/
Connecting to 140.82.113.3:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://140.82.113.3/ [following]
--2022-04-28 10:01:13-- https://140.82.113.3/
Connecting to 140.82.113.3:443... connected.
The certificate's owner does not match hostname ‘140.82.113.3’
如果我浏览 IP 地址,我会收到一条警告消息,指出证书错误,如果我尝试传递它(接受风险),则无法访问网站。
我的主机文件中没有任何阻塞:
cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 zavata.circus.net zavata
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
我的路由表中的一切看起来都很好(192.168.0.1 是我的默认网关,一个 4g 路由器)
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 600 0 0 wlp1s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlp1s0
192.168.0.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp1s0
非常感谢大家!!
答案1
看来问题出在运营商身上。一旦我更改了 FAI/运营商,我就可以毫无问题地访问 github.com。我刚刚在主机文件中添加了一个条目,以便在连接到有故障的 FAI 时访问该网站。