zoukankan      html  css  js  c++  java
  • 解决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
    
  • 相关阅读:
    Python基本命名规范
    复制当前文件夹下所有文件的名称
    Java中返回类型方法名
    BugFree 测试管理系统
    jmeter+badboy免费测试
    Linux的命令
    C语言
    linux基础知识点以及安装
    JMeter安装教程
    linux 操作命令
  • 原文地址:https://www.cnblogs.com/wufengtinghai/p/15747421.html
Copyright © 2011-2022 走看看