Changing your DNS Settings on Ubuntu
Changing your Domain Name Server (DNS) settings from those provided by your broadband provider can improve your internet speed, security and can give you more control. The best way to do this is to change your DNS settings on your router, but some internet providers no longer although this. This is a quick guide to show you how to change the settings on Ubuntu.
You will need to confiure th DNS settings for a wired ethernet connection and each of your Wifi connections seperately. Note that if you use a VPN the VPN settings will override the DNS settings that you have inputed. So if you use more than one wifi connection you'll edit each one. To edit the ethernet connection seach for the 'Network' window in settings and click on the cog next to the wired section.
Changing Your IPv4 Settings
Then select the iPv4 tab abd enter the information for your selected DNS.
8.8.8.8, 8.8.4.4
Cloudflare
1.1.1.1, 1.0.0.1
Changing Your Ipv6 Settings
The majority of broadband providers are still using Ivp4 settings, but just in case they are using Ipv6 here are the settings
2001:4860:4860::8888, 2001:4860:4860::8844
Cloudflare
2606:4700:4700::1111 and 2606:4700:4700::1001
Clearing your DNS Cache
Once you have changed over to your new DNS server you may need to check that it is working by by visiting this site. You may find that it hasn't changed over because linux as cached the last DNS settings, so try clearing the cache.
You can do this by typing the following in the terminal.
sudo /etc/init.d/dns-clean restart
sudo /etc/init.d/networking force-reload
Then check that the DNS cache is 0 by typing the following command.
ps ax | grep dnsmasq
Finally check that your DNS settings have taken effect by returning to What's my DNS