首页 > 系统服务 > 详细

Set DNS Nameservers on Ubuntu 18.04

时间:2020-06-23 15:54:56      阅读:65      评论:0      收藏:0      [点我收藏+]

DNS on Ubuntu 18.04

For years it’s been simple to set up DNS on a Linux machine. Just add a couple of entries to /etc/resolv.conf and you’re done.

# Use Google‘s public DNS servers.
nameserver 8.8.4.4
nameserver 8.8.8.8

But things change and now it’s not that simple. If you now edit /etc/resolv.conf on Ubuntu you’ll find that the edits are ephemeral. If you restart (or even hibernate) your machine then they’ll be overwritten by default content.

nameserver 127.0.0.53
search Home

This is pretty simple to fix though.

  1. Install the resolvconf package.

    sudo apt install resolvconf
  2. Edit /etc/resolvconf/resolv.conf.d/head and add the following:

    # Make edits to /etc/resolvconf/resolv.conf.d/head.
    nameserver 8.8.4.4
    nameserver 8.8.8.8
  3. Restart the resolvconf service.

    sudo service resolvconf restart

Fix should be permanent.

Refer

https://datawookie.netlify.app/blog/2018/10/dns-on-ubuntu-18.04/

Set DNS Nameservers on Ubuntu 18.04

原文:https://www.cnblogs.com/oskb/p/13181977.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!