[Ubuntu Tip] Change DNS settings in Ubuntu
![[Ubuntu Tip] Change DNS settings in Ubuntu](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1588496834423%2FuoMHoMDkm.jpeg&w=3840&q=75)
Tech Addict, Ubuntu Gnu/Linux Fan, Nim/Qt/C++ Developer
Search for a command to run...
![[Ubuntu Tip] Change DNS settings in Ubuntu](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1588496834423%2FuoMHoMDkm.jpeg&w=3840&q=75)
Tech Addict, Ubuntu Gnu/Linux Fan, Nim/Qt/C++ Developer
No comments yet. Be the first to comment.
The recent discovery reported by Flatt Security Research highlights the BatBadBut vulnerability (CVE-2024-24576) as a significant threat to the security of command execution in Windows. The issue arises because cmd, the command-line interpreter for W...

Developing DLLs with Nim for Windows presents unique challenges, especially regarding symbol visibility. A common issue is the exposure of NimMain, an automatic inclusion in Nim-compiled DLLs that is essential for initializing the runtime but not int...

a wrapper for TextBelt

openurl _ _ / \ ._ _ ._ | | |_) | \_/ |_) (/_ | | |_| | \ |_ | v: 2.0.1 @FOXOMAN Open Any Url/File in the default App / WebBrowser MIT LICENSE. Support for MacOS, Windows, Haiku, android/termux, Unix/Linux. Github P...

QtDark QtCreator Dark theme based on QtCreator Dark theme with little modification to make it look better in my eyes :) Support If you like this theme, you can use it for free appreciate your support to have more themes :) Screenshots Install Wind...

You may need to change your DNS settings in Ubuntu for various reason like faster internet or streaming media or safe browsing.
Here is a simple working method you can use, using DNSmasq.
1- Install DNSmasq:
sudo apt-get install dnsmasq
2- Edit DNSmasq Configure file:
sudo gedit /etc/dnsmasq.conf
3- Add your preferred DNS at the end of the file:
in this example I used Google DNS
server=8.8.8.8
server=8.8.4.4
4- Add system hosts file to Network Manager DNSmasq Config:
5- Restart DNSmasq and Network Manager:
sudo service network-manager restart
Previous methods is enough, but you may need to flush the DNS records in the browser you are using if you had any network problem after changing the DNS.
Here how to flush the DNS in Chrome and Chrome based browser like Opera and Vivaldi.
1- Open DNS Settings page in chrome:
chrome://net-internals/#dns
2- Clear Host Cache:

3- Flush Socket Pools

Here three best DNS servers you may want to use.
1- Google DNS: [ Support ]
8.8.8.8
8.8.4.4
2- OpenDNS: [ Support ]
208.67.222.222
208.67.220.220
3- Tunlr: [ Support ]
45.33.81.76
45.33.12.13
Ubuntu 15.04 and Above
Apply this command in the terminal:
nmcli dev show | grep DNS | sed 's/\s\s*/\t/g' | cut -f 2</span>
Ubuntu 14.04
sudo apt-get install nm-tool
nm-tool | grep DNS