Ubuntu18配置dns

查看dns地址

# 查看systemd-resolved服务中的dns配置
systemd-resolve --status | grep 'DNS Servers'

Ubuntu18配置dns_开发语言



修改dns

​vim /etc/systemd/resolved.conf​

[Resolve]
# 取消DNS的注释
DNS=114.114.114.114 223.5.5.5

Ubuntu18配置dns_重启_02



重启systemd-resolved服务

修改完DNS后要重启​​systemd-resolved​​服务才会生效

systemctl restart systemd-resolved



查看修改后的DNS

systemd-resolve --status

Ubuntu18配置dns_bash_03