Change Nameserver on Ubuntu
published: July 16, 2025
tags:
dns |
nameserver |
ubuntu |
reading time: 1 minutes
There are cases where you may want to change your local nameservers to use a popular service provider like Google. I wrote an episode that details a situation where this is required titled: Why do things never work out as seen in tutorials and guides.
Changing your Nameserver
By default the Nameserver is 127.0.0.1 in the resolv.conf
file. To change it is very simple, open /etc/resolv.conf
and change the record to:
nameserver 8.8.8.8
Cloudflare
If you would like to use Cloudflare instead open /etc/resolv.conf
and enter:
nameserver 1.1.1.1