Ubuntu change dns

less than 1 minute read

显现

  • Can not ping, but curl ok
  • apt can not update
    • Could not resolve 'nvidia.github.io'
  • Can not ping 8.8.8.8, but 223.5.5.5(ali dns) ok

如何解决

  • 更改dns
  • ubuntu 18

    sudo vim /etc/systemd/resolved.conf
    DNS=223.5.5.5
    sudo systemctl restart systemd-resolved.service
    
  • 检查
  • systemd-resolve --status
Global
    DNS Servers: 223.5.5.5

Reference

Categories:

Updated: