ubuntu20.04 域名解析暂时失败
生活随笔
收集整理的這篇文章主要介紹了
ubuntu20.04 域名解析暂时失败
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1、前言
ping: www.baidu.com: 域名解析暫時(shí)失敗
2、排查
ifconfig 顯示如下,enx000ec635404a網(wǎng)卡沒有ip配置
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.19.138 netmask 255.255.255.0 broadcast 192.168.19.255
inet6 fe80::d058:2b28:6be9:fe29 prefixlen 64 scopeid 0x20<link>
ether ce:e6:4c:68:04:bc txqueuelen 1000 (以太網(wǎng))
RX packets 276511173 bytes 348533647010 (348.5 GB)
RX errors 0 dropped 23750 overruns 0 frame 0
TX packets 465668303 bytes 541502143429 (541.5 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enx000ec635404a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:0e:c6:35:40:4a txqueuelen 1000 (以太網(wǎng))
RX packets 71039 bytes 12267317 (12.2 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10258570 bytes 11216668369 (11.2 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (本地環(huán)回)
RX packets 6466211 bytes 1905907598 (1.9 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6466211 bytes 1905907598 (1.9 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
sudo vim /etc/netplan/00-installer-config.yaml 創(chuàng)建配置文件,輸入以下內(nèi)容
enx000ec635404a 網(wǎng)卡名稱與上述缺少ip的網(wǎng)卡一致
network:
ethernets:
enx000ec635404a: #配置的網(wǎng)卡的名稱
addresses: [192.168.0.138/24] #配置的靜態(tài)ip地址和掩碼
dhcp4: no #關(guān)閉DHCP,如果需要打開DHCP則寫yes
optional: true
gateway4: 192.168.0.1 #網(wǎng)關(guān)地址
nameservers:
addresses: [192.168.0.1,114.114.114.114] #DNS服務(wù)器地址,多個(gè)DNS服務(wù)器地址需要用英文逗號(hào)分隔開
version: 2
renderer: networkd #指定后端采用systemd-networkd或者Network Manager,可不填寫則默認(rèn)使用systemd-workd
sudo netplan apply 使網(wǎng)絡(luò)配置生效
結(jié)果
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.19.138 netmask 255.255.255.0 broadcast 192.168.19.255
inet6 fe80::d058:2b28:6be9:fe29 prefixlen 64 scopeid 0x20<link>
ether ce:e6:4c:68:04:bc txqueuelen 1000 (以太網(wǎng))
RX packets 276511173 bytes 348533647010 (348.5 GB)
RX errors 0 dropped 23750 overruns 0 frame 0
TX packets 465668303 bytes 541502143429 (541.5 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enx000ec635404a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.138 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::864b:38d0:a3d7:cc1d prefixlen 64 scopeid 0x20<link>
ether 00:0e:c6:35:40:4a txqueuelen 1000 (以太網(wǎng))
RX packets 71039 bytes 12267317 (12.2 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10258570 bytes 11216668369 (11.2 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (本地環(huán)回)
RX packets 6466211 bytes 1905907598 (1.9 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6466211 bytes 1905907598 (1.9 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
3、擴(kuò)展
ping: www.baidu.com: 域名解析暫時(shí)失敗 簡單解決
Ubuntu 20.04修改ip地址
Ubuntu系統(tǒng)重啟后/etc/resolv.conf內(nèi)容丟失的解決方案
linux中nmcli命令使用及網(wǎng)絡(luò)配置
總結(jié)
以上是生活随笔為你收集整理的ubuntu20.04 域名解析暂时失败的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Flink Checkpoint 参数详
- 下一篇: diff命令