How Do I Find My DNS Server Ubuntu?


Angela Bailey

Are you an Ubuntu user and wondering how to find your DNS server? In this tutorial, we will walk you through the step-by-step process to help you locate your DNS server on Ubuntu.

What is a DNS Server?

DNS stands for Domain Name System. It is a crucial component of the internet infrastructure that translates human-friendly domain names into IP addresses, which computers can understand. Every device connected to the internet, including your Ubuntu machine, needs to know the IP address of a website’s server in order to access it.

Typically, your internet service provider (ISP) assigns a default DNS server to your device when you connect it to the network. However, you may need to find this information for various reasons, such as troubleshooting network issues or changing your DNS settings.

Finding Your DNS Server on Ubuntu

To find your DNS server on Ubuntu, follow these steps:

  1. Open a terminal by pressing Ctrl + Alt + T.
  2. Type the following command and press Enter:
$ nmcli dev show | grep 'DNS'

This command will display the DNS servers configured on your system.

Alternative Method:

  1. If the previous command didn’t work or didn’t display any results, you can try another method using the /etc/resolv.conf file.
  2. Type the following command and press Enter:
$ cat /etc/resolv.conf

This will show you the contents of the resolv.conf file, which typically includes the DNS server information.

Note: The resolv.conf file may be automatically generated by NetworkManager, so any changes made directly to this file might be overwritten. It is recommended to use the nmcli command to manage your DNS settings.

Changing Your DNS Server on Ubuntu

If you want to change your DNS server on Ubuntu, follow these steps:

$ nm-connection-editor

This will open the Network Connections window.

  1. Select the network connection for which you want to change the DNS server and click on the gear icon.
  2. In the pop-up window, go to the IPv4 or IPv6 tab, depending on your network configuration.
  3. In the DNS section, choose either “Automatic” or “Manual” and enter the desired DNS server addresses. If you choose “Manual,” click on the “+” button to add a new DNS server entry.
  4. Click on “Apply” and close the Network Connections window.

This will update your DNS server settings for the selected network connection on Ubuntu.


In this tutorial, we have learned how to find and change your DNS server on Ubuntu. Knowing your DNS server can help diagnose network issues and changing it can provide additional control over your internet browsing experience. Remember that misconfiguring your DNS settings can lead to connectivity problems, so be cautious when making changes.

We hope this article has provided you with the information you were seeking. Happy browsing!

Discord Server - Web Server - Private Server - DNS Server - Object-Oriented Programming - Scripting - Data Types - Data Structures

Privacy Policy