Nameserver in Ubuntu
Table of contents
Change default resolver to 1.1.1.1
- Run
sudo vim /etc/resolv.conf
- Comment out default nameserver and add a new line
# nameserver 127.0.0.53
nameserver 1.1.1.1
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 nameserver 1.1.1.1
nameserver 8.8.4.4
- Restart the service
sudo systemctl restart resolvconf.service
sudo systemctl restart systemd-resolved.service