DNS translates domain names into IP addresses so your system knows where to connect. In this guide, you will learn exactly how to check DNS server settings in Linux across all major distributions, including Ubuntu, Debian, CentOS, and RHEL.
You’ll learn the difference between static configuration files and dynamic network managers so you can accurately list DNS servers for troubleshooting or security audits.
Whether you’re a system administrator working via SSH or a desktop user navigating the GNOME interface, this comprehensive walkthrough ensures you never have to wonder “which DNS am I using” again.
How to Find the Current DNS Server in Linux
There are four common ways to view the DNS server settings in Linux:
Method 1: Check Your DNS Server with the Terminal
The Linux terminal is an incredibly powerful tool, and for tasks like this, it’s often the fastest way to get the information you need. You can get this information quickly with a single command. Follow the steps below to get started:
Step 1: Open the Terminal
First, open the terminal application. You can find it in your applications menu, or use the common keyboard shortcut: Ctrl + Alt + T.
This will open up a new window, where you can enter your commands. If you are connected to the server via SSH, then you don’t need to take any additional steps. You can type your commands in this shell, as it’s the terminal itself.
Step 2: Check the resolv.conf File
For this step, you will use the cat command, which simply reads a file and displays its contents on the screen.
In your terminal, type the following command and press Enter:
cat /etc/resolv.confYou will see an output similar to the image below:

Look for the line that starts with nameserver. The IP address immediately following it is the DNS server your system is configured to use. In the example above, the DNS server is 192.168.0.1.
If you see an address like 192.168.0.1, your system is using your router for DNS, which then forwards the request to your ISP. This is a very common and default setup.
If you have explicitly defined the DNS servers in your network configuration, then you might get an output similar to the following image:

In the above example, the computer is using three different DNS servers with the following IP addresses: 1.1.1.1, 8.8.8.8, and 9.9.9.9, which belong to Cloudflare, Google, and Quad9, respectively.
systemd-resolved vs /etc/resolv.conf
If you run cat /etc/resolv.conf on modern Linux distributions (like Ubuntu 18.04 and later), you will see a nameserver entry for 127.0.0.53. This doesn’t mean your actual DNS server is on your own machine.
On these systems, /etc/resolv.conf is often a symbolic link to a “stub” file managed by systemd-resolved. The 127.0.0.53 address is a local DNS stub listener that forwards your requests to the actual upstream DNS servers.
While this file is technically “accurate” for the OS, it doesn’t list the external DNS providers (like Google or Cloudflare) you’re actually using. To see the true upstream nameservers on these systems, you must use Method 3 (resolvectl) or Method 4 (nmcli).

Method 2: Find The DNS Server in Linux Using The GNOME Graphical Interface
If you prefer clicking over typing, Linux desktop environments such as GNOME provide a user-friendly way to see your network settings.
Step 1: Open Your System Settings
Click on the system tray area in the top-right corner of your screen, where you see the icons for Wi-Fi, volume, and power. In the menu that appears, click the gear icon (⚙️) to open the Settings window.
Step 2: Go to Network Settings
In the Settings window, look at the menu on the left-hand side. Click on either Wi-Fi or Wired, depending on your connection method.
Step 3: Open Your Active Connection’s Details
You will now see a list of available networks. Find the network you are currently connected to (it will be the one that’s toggled on). To the right of its name, click the gear icon (⚙️) to open its specific settings.
Step 4: Find Your DNS Entry
A new window will pop up with several tabs. It will open on the Details tab by default. Here, you can immediately see a summary of your connection. Look for the DNS entry to find your server’s IP address.

As you can see, the DNS is listed as 192.168.0.1, which matches what we found in the terminal.
Step 5: Understanding the “Automatic” Setting
To see why you have this DNS server, click on the IPv4 tab at the top of this same window.
Notice that the DNS setting has a switch toggled to Automatic. This setting, along with the Automatic (DHCP) option for IPv4 Method, instructs your computer to automatically accept the network settings provided by your router.
Most systems use DNS settings provided automatically by the router (via DHCP). Switching to Manual lets you specify your own DNS server. If you want to manually set a different DNS server (such as Google’s 8.8.8.8), toggle this switch off, then enter the new IP address in the field.

Method 3: Use resolvectl
On Linux distributions that use systemd-resolved, the resolvectl command is the recommended way to check your DNS status. This tool provides a detailed breakdown of which DNS servers are assigned to specific network interfaces.
To use this method, you first need to connect to your remote server via SSH as described in Method 1. Once you are logged in to the terminal, run the following command:
resolvectl status
Look for the “DNS Servers” and “Current DNS Server” lines under your active network interface. This will show the actual IP addresses of the DNS providers your system is querying, bypassing the local stub address.
Method 4: Use nmcli (NetworkManager Systems)
If your server uses NetworkManager to handle connections (common in RHEL, CentOS, and most Desktop environments), the nmcli tool is the most efficient way to query DNS settings directly from the networking stack.
Use the following command to display your network details:
nmcli device show | grep IP4.DNSThis command filters the output to show only the IPv4 DNS servers assigned to your active devices. It displays the DNS servers exactly as they were received from DHCP or manually configured in the NetworkManager profile.
Bonus: Query a Site Using Any DNS Server
After identifying your DNS server, you may not be completely satisfied with it. If you are facing network issues, you can bypass your local settings entirely and request a website’s IP address from any public DNS server worldwide.
Why would you do this?
If a site loads for others but not for you, your DNS server might be outdated, overloaded, or applying filters. Querying a public DNS server gives you a clean comparison.
dig @<DNS-SERVER-IP> <WEBSITE-TO-LOOKUP>Let’s break that down:
- dig: The command to run the tool.
- @<DNS-SERVER-IP>: The @ symbol tells dig, “direct your question to this specific server.” Replace <DNS-SERVER-IP> with the IP address of the server you want to query, such as @8.8.8.8 for Google.
- <WEBSITE-TO-LOOKUP>: The domain name you want the IP address for, such as runcloud.io.
Let’s ask Google’s public DNS server (8.8.8.8) for the IP address of runcloud.io. Open your terminal and run this command:
dig @8.8.8.8 runcloud.ioThe terminal will print a block of text that might look a little intimidating at first, but don’t worry! You only need to concern yourself with one specific part.

Scroll down until you find the ;; ANSWER SECTION:. This is the response from the DNS server
runcloud.io. 300 IN A 104.26.10.235
runcloud.io. 300 IN A 104.26.11.235
runcloud.io. 300 IN A 172.67.68.114This tells us that, according to Google’s DNS, runcloud.io has three IP addresses: 104.26.10.235, 104.26.11.235, and 172.67.68.114. It’s that simple!
If you prefer a graphical interface, Google offers a simple web tool that performs the same function. You can visit https://dns.google/ to see the same query we just ran, but in your browser.
This will display the raw DNS information in a format that computers prefer (called JSON), making it easy to spot the IP address in the “data” field. It’s a great alternative if you’re not in front of a terminal.

When Applications Bypass Your System DNS
The IP address you found using the methods above is the default DNS server for your system. However, it’s essential to note that some applications may opt to disregard it and use their own. Before you spend hours troubleshooting, be aware of these common overrides:
- DNS-over-HTTPS (DoH): Modern browsers can use DNS-over-HTTPS, which bypasses your system DNS for privacy. VPNs also override DNS to keep traffic secure.
- Virtual Private Networks (VPNs): When you connect to a VPN, it almost always forces your computer to use its own private DNS servers. This is a critical security feature. If your computer uses your regular DNS while connected to a VPN, your internet service provider may still be able to see which websites you’re trying to visit, defeating a key purpose of the VPN.
Next Steps for DNS Management
You now know how to check your DNS server from both the terminal and GNOME, as well as how to test any DNS provider using the dig command.
DNS checks are only one part of managing a server. RunCloud provides an easy and reliable way to deploy and manage Linux servers without manual configuration. It handles security, updates, monitoring, and performance tuning, so you can focus on your applications.
If you want a simpler way to manage Linux servers and avoid repetitive configuration work, RunCloud gives you a clean dashboard for deployments, updates, backups, and security.
Create your FREE RunCloud account and streamline your server workflow today.
FAQs
How do I check which DNS server my Linux system is using?
You can check your active DNS servers by running the resolvectl status command.
Why does /etc/resolv.conf show 127.0.0.53 instead of my real DNS?
The IP address 127.0.0.53 indicates that your system is using a local DNS stub listener managed by systemd-resolved. This local service acts as an intermediary, receiving your queries and forwarding them to the actual upstream DNS servers, which you can identify using the resolvectl status command.
How do I set DNS to 8.8.8.8 in Linux?
You can set your DNS to Google’s public DNS by running nmcli connection modify [connection-name] ipv4.dns “8.8.8.8”. For persistent changes on Ubuntu servers, you must add 8.8.8.8 to the nameservers section of your configuration file in /etc/netplan/ and run sudo netplan apply.







