重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛

标题: Ubuntu 24.04设置网络解析DNS服务器 [打印本页]

作者: 郑全    时间: 6 天前
标题: Ubuntu 24.04设置网络解析DNS服务器
Ubuntu 24.04 用 systemd-resolved 管理 DNS,修改 /etc/systemd/resolved.conf:

sudo nano /etc/systemd/resolved.conf

找到 [Resolved] 段,改 DNS 服务器:

[Resolved]
DNS=8.8.8.8 8.8.4.4
Domains=localdomain

然后重启:
sudo systemctl restart systemd-resolved

查看当前 DNS:
resolvectl status


root@hermes:~# resolvectl status
Global
         Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
  resolv.conf mode: stub
Current DNS Server: 8.8.4.4
       DNS Servers: 8.8.8.8 8.8.4.4
        DNS Domain: localdomain

Link 2 (ens33)
    Current Scopes: none
         Protocols: -DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
root@hermes:~#


临时改(重启失效):
sudo systemd-resolve --set-dns=1.1.1.1 --interface=eth0







欢迎光临 重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2