解决ubuntu突然无法联网问题

一、问题描述

今天使用笔记本远程办公的时候,突然电脑无法联网了,使用chrome浏览器访问网页出现如下错误

This site can’t be reachedwww.baidu.com’s server IP address could not be found.
Try:

Checking the proxy, firewall, and DNS configuration
DNS_PROBE_FINISHED_BAD_CONFIG

二、环境信息

笔记本的硬盘里安装的是Ubuntu 21.04
使用无线WiFi链接网络

三、定位问题

  1. 是不是WiFi的问题呢?

    将路由器的无线网络信号分开为2G和5G的单独频段,分别单独链接无法联网;

    使用本地安装的windows 10进行测试,可以正常联网;

  2. 是不是Ubuntu本身出问题了?

    使用Ubuntu的recovery模式,尝试修复网络,还是无法正常联网;

    使用Ubuntu U盘启动盘,链接WiFi可以正常联网;

  3. 是否可以ping通一些重要的ip?

光猫可以正常ping通
mango@mango-ubuntu:/etc$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=63 time=2.30 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=63 time=2.98 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=63 time=1.95 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=63 time=3.45 ms
64 bytes from 192.168.1.1: icmp_seq=5 ttl=63 time=9.23 ms
^C
--- 192.168.1.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 1.950/3.981/9.229/2.675 ms

路由器可以正常ping通
mango@mango-ubuntu:/etc$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=63 time=2.30 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=63 time=2.98 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=63 time=1.95 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=63 time=3.45 ms
64 bytes from 192.168.1.1: icmp_seq=5 ttl=63 time=9.23 ms
^C
--- 192.168.1.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 1.950/3.981/9.229/2.675 ms

google的DNS服务器可以ping通
mango@mango-ubuntu:/etc$ 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=110 time=373 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=110 time=397 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 2 received, 33.3333% packet loss, time 2000ms
rtt min/avg/max/mdev = 372.858/385.097/397.337/12.239 ms

百度无法ping通
mango@mango-ubuntu:/etc$ ping www.baidu.com
ping: www.baidu.com: Temporary failure in name resolution

通过以上分析可以知道是由于我笔记本发出的请求无法进行DNS的域名解析导致的。

四、解决方案

新建resolv.conf,并添加对应的DNS server即可

nameserver 114.114.114.114
nameserver 8.8.8.8
nameserver 192.168.1.1
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值