- How to Find My DNS Server IP Address in Linux
- How to Find DNS Server IP Address Using Command-Line Interface
- How to Find DNS Server IP Address Using Graphical User Interface
- Conclusion
How to Find My DNS Server IP Address in Linux
We have two different ways to find out the DNS Server IP address in the Linux operating system:
We will perform this task on the Ubuntu 22.04 version.
How to Find DNS Server IP Address Using Command-Line Interface
In Linux distributions, there are always multiple command-line utilities to execute any specific task. Similarly, to check the DNS Server IP Address, several commands are here:
Before getting started with all of the above commands, make sure to update all of the system packages:
Let’s run command-line utilities to display the result:
1. Find DNS Server IP Address Through /etc/resolv.conf File
There are multiple command tools to access the /etc/resilv.con file such as cat, less, and grep. 1
1. Using the cat command
The Concatenate (cat) command helps to display the content of a file as a standard output. It is also useful to print the DNS Server IP Address in the terminal:
Note that 127.0.0.53 is a loopback address, in this case forwarding the request to the DNS server which can be found using the following command:
In the output, you can see the DNS IP:
101.50.101.51 > Secondary DNS
2. Using the less Command
The less command function is similar to the Linux cat command. The difference is that the cat command reads a small file’s data and displays its output; whereas the less command is used to read extensive file data and display its output page by page.
We can also utilize this utility to find the DNS Server IP Address by running the command mentioned below:
This address 127.0.0.53 is a loopback address used to send requests to the DNS server 101.50.101.50.
3. Using grep Command
Linux grep command is used to search and match similar patterns in a file and display them. Run the given command to find out the DNS Server IP Address using this command-line utility:su
2. Find the DNS Server IP Address Through nmcli Command
The NetworkManager Command-line Interface (nmcli) is the Linux command-line utility used to handle network-related issues and configuration.
Execute the given command to let it display the DNS Server IP Address on the Ubuntu system:
3. Find DNS Server IP Address Through dig Command
The Domain Information Groper (dig) command is used to retrieve information regarding the DNS name server. It looks out for the specific query name server given by the user and prints the output.
How to Find DNS Server IP Address Using Graphical User Interface
Not only using the CLI but there’s also another way to find the DNS Server IP address i.e., GUI.
Step 1: Move to the Show Applications icons located at the bottom left corner of the Ubuntu 22.04 screen and click it:
Step 2: Click on Settings from the displayed screen; if you don’t find it, type Settings in the search box:
Step 3: Move to the Network from the left panel and select it:
Step 4: In the Network screen, move to the gear icon in Wired section and select it:
Step 5: The displayed window will show the networking details including the DNS server addresses:
101.50.101.51 > Secondary
Conclusion
The DNS maps the IP addresses whenever the user sends a domain request to the server. It works as a phonebook on the internet that matches the correct IP address and returns it to the user. This guide has mentioned multiple methods to find the DNS server IP address on a Linux system i.e., through Command-line Interface and Graphical User Interface. By using the terminal method, we have found numerous command-line tools to get the DNS server IP address. You can use the one that is most suitable for you.