How to Change DNS on Ubuntu Server?

  • How to Change DNS on Ubuntu Server?

Changing the DNS server in Ubuntu can actually increase your network speed and eliminate internet problems in Linux. It's a common troubleshooting step to fix it.

Hi Guys, in today's content, as the techdataz team, we will tell you how DNS or Domain Name Server, you should know how human-friendly domain names ( for example, ) are machine readable and the internet infrastructure that translates them into IP addresses ( for example, ) is important. Never forget that it has a component.

DNS is actually needed to forward this internet traffic to the right destination, different ports can get in the way, but it's best to do this with DNS forwarding and most internet-based services, including email and file transfer, use DNS in some way. If you have the best configured DNS controls in place, this will be the best for you.

Generally, Internet Service Providers automatically provide a default DNS for your network or can come to you manually and provide it in the most powerful way. However, for potentially faster and more reliable service, using private or third-party DNS is the most reliable setup system for you.

Actually, friends, we would like to tell you that you can change the DNS server in Ubuntu by editing a configuration file through the network settings or using a different command line.

Change DNS Through the GUI Network Settings

Generally speaking, to change network settings, it would be best for you to log in to Ubuntu as an administrator and follow the steps below.

Actually, when we look at it in general terms, you should go to Settings, which you can find in the Application drawer. Then you have to click on the Network tab at the top of the left sidebar.

How to Change DNS on Ubuntu Server?

Now, friends, let's come to the benefits of beans: The techdataz team tells you such idioms from time to time, don't be offended, our aim is for you to read our content in the best quality and most comfortable way and in the most natural way. Now we come, in the Network settings you will see your Wired and Wireless network connection here. You will need to click on the Gear icon next to it to open the drop-down menu with multiple tabs.

Actually Now go to the IPv4 tab and make sure that the IPv4 Method is set to Automatic ( DHCP ) because this is set automatically. Just below that you will see the DNS setting. You should turn off the Automatic button next to it, turn it off.

How to Change DNS on Ubuntu Server?-2

Now in the generalization add the New DNS server IP addresses separated by commas into the blank field and click Apply. From the moment you click on Friends, you will need to verify that the IP address is correct and secure, which is critical to your network and privacy.

Actually guys, if you're not sure which DNS server to choose, check out a comparison of Google DNS vs Cloudflare DNS, two of the most popular options. This list of DNS services to protect your family is useful even if your main concern is security.

Using the Command Line

If you are using Linux, we would also like to say that you will probably prefer to operate via the terminal. Yes, friends, we are now showing you how you can change the DNS in Ubuntu via the command line as the techdataz team.

Open terminal and you should run:


sudo nano /etc/resolv.conf


Now we are proud to present to you what is actually happening and you can have no doubt as this will open the file containing the current DNS server settings. It will open this file anyway.

You must replace the existing nameserver IP address with the new DNS server IP address you want to use. Again, to stay safe, you should definitely make sure that you are using a reliable DNS server.

Using the Command Line

Press Ctrl + O and Enter to save the changes. Then, press Ctrl + X to exit nano.

Restart the networking service by running:


sudo systemctl restart NetworkManager


We would like to tell you as the techdataz team that you have now successfully changed the DNS in Ubuntu using the command line.

Easily Change Your DNS on Ubuntu

We think we have explained to you the easiest and simplest process to change DNS in Ubuntu, which you can do by editing the configuration file in the terminal or through the GUI network settings. Using private or third-party DNS servers can potentially increase the speed and reliability of internet-based services in Ubuntu and provide additional network connection security.

It is also recommended that you be careful when changing DNS servers because doing it wrong may also negatively affect your internet connection. However, we would like to finally tell you that changing your DNS in Linux can be useful to improve your overall internet experience.

You can find the Coding category section here. Yes, friends, we are proud that you read our most useful content and that we were useful to you on these subjects. Our sole aim as the techdataz team is to provide you with the most accurate and proper step-by-step articles. See you in our new article.



Related Articles

PHP Function Parameters

PHP Function Parameters. You will learn about function parameters, pass arguments by value, and pass arguments by reference in this course.

What is BIND Address Definition in MYSQL?

What is BIND Address Definition in MYSQL? The bind-address setting tells MySQL whether it can listen to a TCP socket for new connections.

5 Best GitHub Alternatives for Hosting Your Project

5 Best GitHub Alternatives for Hosting Your Project. We explain the best GitHub Free server resources for you.

Python vs. Java: The Best Language for 2023

Python vs. Java: The Best Language for 2023. Unsure about the programming language you should learn? The only option if you want to start coding in 2023 is this.