Ubuntu20系统里面PING不通域名

技术问题

Ubuntu20系统里面PING不通域名

2024-05-29 09:22


Ubuntu20系统里面PING不通域名,如何设置dns并生效

                                            




vi /etc/systemd/resolved.conf

将resolved.conf内容中的 #dns= 改为 dns8.8.8.8

保存后 ,继续执行以下命令,逐行复制并执行

systemctl restart systemd-resolved

systemctl enable systemd-resolved

mv /etc/resolv.conf  /etc/resolv.conf.bak

ln -s /run/systemd/resolve/resolv.conf /etc/

cat /etc/resolv.conf    #查看dns文件再次PING 域名,就会发现正常了。


标签:
  • Ubuntu20系统里面PING不通域名,如何设置dns并生效