Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Change DNS for Ubuntu, Linux

Follow a clear guide to change DNS for Ubuntu, Linux, including setup details, useful tips, and fixes for issues you may encounter.

Table of Contents

This practical guide walks through how to change DNS for Ubuntu, Linux. It organizes the required steps, settings, and checks so you can complete the task with fewer mistakes.

There are 2 ways to change DNS for Ubuntu, either through the user interface or through Terminal. Each method has its get advantages and disadvantages.

Method 1: Change DNS for Ubuntu from the User Interface

Follow the steps below to change DNS for Ubuntu from the user interface:

Step 1: First open the Ubuntu System Settings Window, then find and select Network.

Method 1: Change DNS for Ubuntu from the User Interface - step or example 1

Step 2: The screen will now display a list of all network connections near you and the network connection you are using.

Method 1: Change DNS for Ubuntu from the User Interface - step or example 2

Step 3: Next find and select the settings icon, which is a cog icon, next to the network name you are connecting to. Step 4: On the next window displayed in the window, find and select The IPv4 tab.

Method 1: Change DNS for Ubuntu from the User Interface - step or example 3

Step 5: Here find and select the DNS Box, enter the DNS server address you want to use in the box.

Method 1: Change DNS for Ubuntu from the User Interface - step or example 4

Note: To use multiple DNS addresses, you must enter a comma between the addresses.

Step 6: Finally select Apply To apply the changes.

Method 2: Change DNS for Ubuntu Through Terminal

Another way to change DNS on Ubuntu is through the Terminal command window. The advantage of this method is that it is easy to do and does not require digging into the settings like method 1 above.

The first step you need to do is add the nameserver to the Dnsmasq configuration file. However, because dnsmasq is not installed on Ubuntu by default, we will have to take the additional step of installing dnsmasq. To do this thing:

Open Terminal and enter the command below:

Sudo Apt-get Install Dnsmasq

Sudo Apt-get Install Dnsmasq - step or example 5

After installing dnsmasq, the next step is to run the command below to edit the DNS configuration file:

Sudo Nano /Etc/dnsmasq. Conf

Sudo Nano /Etc/dnsmasq. Conf - step or example 6

On the window displayed in the window, find the entry named " Add other nameservers here " and replace it with the DNS server address you want to use as shown below:

Sudo Nano /Etc/dnsmasq. Conf - step or example 7

So above, TipsMake has just shown you 2 ways to change DNS for Ubuntu.

Besides, if you use Windows 10, you can also change DNS in the simplest way through the steps below.

FAQ

What do I need before I change DNS for Ubuntu, Linux?

Prepare the required device, software, account access, and any files mentioned in the steps. Back up important data before changing system settings.

Why does the process look different on my device?

Menus and options can vary by operating system, app version, device model, or region. Use the closest matching setting and check the official documentation when needed.

What should I do if a step does not work?

Restart the app or device, confirm permissions and connectivity, update the software, and repeat the step carefully. Avoid unofficial downloads or tools.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.