我有一个奇怪的问题。如果我连接到办公室的以太网或 WiFi,我就可以上网。但我无法通过家庭 wifi 或手机热点上网。
当我尝试使用浏览器打开 Google.com 时,出现以下信息:DNS_PROBE_FINISHED_BAD_CONFIG
他们两个都没有工作。
我尝试使用 dns-clean 刷新 DNS。它仍然没有修复。
综上所述,我只能连接雇主的wifi。除此之外,我可以连接到 wifi,但互联网可以正常工作。
非常感谢您的帮助。
xyz-username@zyx-abc-computer-name:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.20.10.1 0.0.0.0 UG 600 0 0 wlp4s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlp4s0
172.20.10.0 0.0.0.0 255.255.255.240 U 600 0 0 wlp4s0
xyz-username@xyz-abc-computer-name:~$ ifconfig
enp0s31f6 Link encap:Ethernet HWaddr 54:ee:75:b1:51:60
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21839 errors:0 dropped:0 overruns:0 frame:0
TX packets:9198 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:14318848 (14.3 MB) TX bytes:1431218 (1.4 MB)
Interrupt:16 Memory:f1200000-f1220000
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:65536 Metric:1
RX packets:3700 errors:0 dropped:0 overruns:0 frame:0
TX packets:3700 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:5835931 (5.8 MB) TX bytes:5835931 (5.8 MB)
wlp4s0 Link encap:Ethernet HWaddr e4:a7:a0:df:74:9c
inet addr:172.20.10.6 Bcast:172.20.10.15 Mask:255.255.255.240
inet6 addr: fe80::e86e:2246:44a:a2e5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:35472 errors:0 dropped:0 overruns:0 frame:0
TX packets:56362 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:26975714 (26.9 MB) TX bytes:8620526 (8.6 MB)
xyz-username@xyz-abc-computer-name:~$ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=false
xyz-username@xyz-abc-computer-name:~$ cat /etc/n
nanorc network/ networks newt/ nsswitch.conf
xyz-username@xyz-abc-computer-name:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
xyz-username@xyz-abc-computer-name:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 xyz-abc-computer-name
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
xyz-username@xyz-abc-computer-name:~$ 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
domain abc.net
search mou.abc.net abc.com abc.net
nameserver 172.23.1.16
nameserver 172.19.1.16
nameserver 172.21.1.16
options timeout:1 attempts:1
nameserver 127.0.1.1
search hsd1.wxy.comcast.net
xyz-username@xyz-abc-computer-name:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=50.1 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=46.8 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=56 time=237 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=56 time=186 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=56 time=52.5 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=56 time=50.1 ms
^Z
[1]+ Stopped ping 8.8.8.8
xyz-username@xyz-abc-computer-name:~$ nslookup google.com
;; connection timed out; no servers could be reached
xyz-username@xyz-abc-computer-name:~$ nslookup google.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: google.com
Address: 172.217.11.14
xyz-username@xyz-abc-computer-name:~$ ls /etc/network/interfaces.d/
xyz-username@badri-abc-computer-name:~$
答案1
由于您可以 ping 公共 DNS 服务器 8.8.8.8 的 IP 地址,因此您可以访问互联网并且您的网关配置正常。
您的 DNS 服务器似乎无法正常服务。
尝试将 ISP 的 DNS 服务器更改为一些公共服务器(8.8.8.8、4.2.2.3 等)
如果您使用网络管理器,请使用其编辑器来使用“仅自动(DHCP)地址”,如果您使用文本模式更新/etc/resolv.conf
以使用工作的 DNS 服务器