[參考鏈接] (https://www.techrepublic.com/article/how-to-set-dns-nameservers-in-ubuntu-server-18-04/)
裝了ubuntu20.04,修網(wǎng)修改dns,百度了一下粥鞋,中文網(wǎng)站的方法都不對(duì),最后還是google出來(lái)的缘挽。
修改網(wǎng)絡(luò)配置文件:
sudo vim /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
enp0s3:
addresses:
- 192.168.2.51/24
gateway4: 192.168.2.1
nameservers:
addresses:
- 192.168.2.1
version: 2
再執(zhí)行
sudo netplan apply
設(shè)置完成