ubuntu DNS 配置

ubuntu DNS 配置



DNS

Google Public DNS:8.8.8.8、8.8.4.4

114公共DNS:114.114.114.114

AliDNS:223.5.5.5、223.6.6.6

Baidu DNS:180.76.76.76

Tencent DNS:119.29.29.29



深圳南山,移动宽带,ping DNS地址速度比较(连续ping command:ping -t IpAddress):




ubuntu DNS配置


临时修改

sudo vim /etc/resolv.conf
文件最后面加入:
nameserver x.x.x.x
namseserer y.y.y.y



resolvconf

sudo apt-get install resolvconf
sudo vim /etc/resolvconf/resolv.conf.d/tail
add:
nameserver x.x.x.x
nameserver y.y.y.y
$ sudo resolvconf -u
/etc/resolv.conf,最下面就多了2行 dns ip;



/etc/network/interfaces

sudo vim /etc/network/interfaces
文件最后面加入
nameserver x.x.x.x

wyk@ubuntu:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto ens33
iface ens33 inet static
address 192.168.100.9
netmask 255.255.255.0
gateway 0.0.0.0
iface ens33 inet6 auto

dns-nameservers 8.8.8.8

wyk@ubuntu:~$ 


通过网络管理图形界面配置;



- written by wangyangkai.

posted @ 2022-06-01 22:59  王阳开  阅读(570)  评论(0编辑  收藏  举报