Categories: TutorialsUbuntu

Get The Active DNS Servers On Linux

The Domain Name System (DNS for short) is one of the most important parts of the internet infrastructure. It converts the easy to remember domain names, into IP (and IPv6) addresses, that aren’t so friendly to the end user.
Regardless of the distribution of Linux that you are using (such as Ubuntu, CentOS, Debian, Arch, Redhat, etc), the process of determining what DNS servers are currently being used for domain name resolution is the same.
To determine what DNS servers are being used, you simply need to view the contents of the “/etc/resolv.conf” file. This can be done via a graphical editing tool such as gedit, or can easily be viewed from the command line with a simple “cat” of the file, to show the contents. The command below will outline how to determine the DNS servers in use.
Show

Sponsored
the active DNS servers on Linux:

$ cat /etc/resolv.conf

You will end up with some output like this:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4

You may or may not have the comments at the top of the file, as that will depend on your distribution, but you should have at least one or more “nameserver” records. These will be the name server IP’s that your system will currently be using. In this example, 8.8.8.8 and 8.8.4.4.
Note that this must be an IP address, and cant be a domain name.

Sponsored

The post Get The Active DNS Servers On Linux appeared first on Networking HowTos.

Ubuntu Server Admin

Recent Posts

Install FreePBX and Asterisk on Ubuntu 24.04 LTS for security patches until 2036

Deploying FreePBX and Asterisk on a single Ubuntu virtual machine in a public cloud is…

6 hours ago

Certification as a strategy: How Ubuntu & SystemReady boost hardware competitiveness

Canonical and MediaTek enhance reliability, accelerate market entry and reduce Total Cost of Ownership (TCO)…

6 hours ago

Ubuntu 20.04 LTS on Azure: how to stay secure after standard support ends

As Ubuntu 20.04 LTS (Focal Fossa) standard support ends on May 31, 2025, Azure users…

6 hours ago

Ubuntu Weekly Newsletter Issue 881

Welcome to the Ubuntu Weekly Newsletter, Issue 881 for the week of February 23 –…

22 hours ago

Experiment Tracking with MLFlow in Canonical’s Data Science Stack

Welcome back, data scientists! In my previous post, we explored how easy it is to…

1 day ago

How to Install vLLM on Linux Using 4 Easy Steps

In this article, we will see how to install vLLM on Linux using 4 easy…

1 day ago