Link Search Menu Expand Document

Nameserver in Ubuntu

Table of contents

Change default resolver to

  1. Run sudo vim /etc/resolv.conf
  2. Comment out default nameserver and add a new line
     # nameserver
     options edns0

Set a permanent DNS resolver in the server

  • Install resolvconf
    sudo apt update
    sudo apt install resolvconf
  • Run resolvconf service
    sudo systemctl start resolvconf.service
    sudo systemctl enable resolvconf.service
    sudo systemctl status resolvconf.service
  • Edit the config file
    sudo vim /etc/resolvconf/resolv.conf.d/head
  • Add the below new nameservers to config file
  • Restart the service
    sudo systemctl restart resolvconf.service
    sudo systemctl restart systemd-resolved.service