How to Find My DNS Server IP Address in Linux

Introduction

Finding your DNS server IP address in Linux is a relatively simple process. DNS (Domain Name System) is a system that translates domain names into IP addresses. Knowing your DNS server IP address can be useful for troubleshooting network issues or configuring network settings. In this guide, we will show you how to find your DNS server IP address in Linux. We will cover different methods for different Linux distributions, such as Ubuntu, CentOS, and Fedora.

How to Find My DNS Server IP Address in Linux

1. Open a terminal window.

2. Type in the command “cat /etc/resolv.conf” and press enter.

3. The output will show the DNS server IP address. It will be listed as “nameserver” followed by an IP address.

DNS (Domain Name System) is a fundamental facilitator of several networking technologies such as mail servers, Internet browsing, and streaming services e.g. Netflix and Spotify, among others.

It works on a special computer called a DNS server – which keeps a database record of several public IP addresses along with their corresponding hostnames for it to resolve or translate hostnames to IP addresses upon user request.

This happens so that we would not need to bother ourselves with remembering the IP addresses of the different websites we visit.

While there are several things we can discuss on DNS servers such as redirection and malware attack prevention, our focus today is on how to find out your very own dns server IP address.

There are several ways to check for it depending on the Operating System that you’re running but Linux, BSD, and Unix-like systems all share the same method so let’s begin with them.

How to Find My DNS Server IP Address

1. To find out your DNS Server IP address, use the following cat command or less command.

$ cat /etc/resolv.conf
OR
$ less /etc/resolv.conf

2. Another way is to use the following grep command.

$ grep "nameserver" /etc/resolv.conf

nameserver 109.78.164.20

3. In newer Linux distributions that use systemd, you can use the systemd-resolve command to check the DNS server.

$ systemd-resolve --status | grep "DNS Servers"

4. If you’re using NetworkManager, you can use the nmcli command to get the DNS server information.

$ nmcli dev show | grep 'IP4.DNS'

Here, nameserver 192.168.0.1 is a name server IP address in what is called the dot notation – the format that applications on your workstation use for DNS routing.

Find DNS Name Server in Linux
Find DNS Name Server in Linux

How to Find My Website DNS Server IP Address

To find out a website DNS Server IP address, you can use the following dig command, which is used to query DNS information.

$ dig tecmint.com
Sample Output
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.68.rc1.el6_10.1 <<>> tecmint.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30412
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;tecmint.com.			IN	A

;; ANSWER SECTION:
tecmint.com.		21	IN	A	204.45.67.203
tecmint.com.		21	IN	A	204.45.68.203

;; Query time: 0 msec
;; SERVER: 209.74.194.20#53(209.74.194.20)
;; WHEN: Mon Jun 24 07:25:42 2019
;; MSG SIZE  rcvd: 61

The output will provide you with a list of IP addresses for authoritative nameservers for your website (i.e., the DNS servers responsible for your domain).

tecmint.com.		21	IN	A	204.45.67.203
tecmint.com.		21	IN	A	204.45.68.203

Please note that the actual IP addresses you receive may vary depending on your website hosting provider or domain registrar. If your website is using third-party DNS services like Cloudflare or Google Cloud DNS, the IP addresses will be specific to those services.

Easy right? Perhaps we’ll talk about primary and secondary DNS Server addresses next time. Till then, feel free to share and drop your comments/suggestions in the discussion section below.

How to Find My DNS Server IP Address in Linux

If you are using Linux, you may need to know the IP address of your DNS server. Knowing the IP address of your DNS server can help you troubleshoot network issues, or even just to make sure that your DNS server is working properly. Here is a quick guide on how to find your DNS server IP address in Linux.

Step 1: Check Your Network Configuration

The first step is to check your network configuration. You can do this by running the command ifconfig in the terminal. This will show you the IP address of your network interface, as well as the IP address of your DNS server. The DNS server IP address will be listed as the “nameserver”.

Step 2: Check Your /etc/resolv.conf File

The next step is to check your /etc/resolv.conf file. This file contains the IP addresses of your DNS servers. To view the contents of this file, you can use the command cat /etc/resolv.conf. This will show you the IP addresses of your DNS servers.

Step 3: Check Your Network Manager

If you are using a network manager, such as NetworkManager or Wicd, you can also check the IP address of your DNS server. To do this, open the network manager and look for the “DNS” section. This will show you the IP address of your DNS server.

Step 4: Check Your DHCP Server

If you are using a DHCP server, such as dhcpd or dhclient, you can also check the IP address of your DNS server. To do this, open the DHCP server configuration file and look for the “nameserver” option. This will show you the IP address of your DNS server.

Conclusion

Finding your DNS server IP address in Linux is a simple process. All you need to do is check your network configuration, your /etc/resolv.conf file, your network manager, or your DHCP server. Once you have the IP address of your DNS server, you can use it to troubleshoot network issues or just to make sure that your DNS server is working properly.

Jaspreet Singh Ghuman

Jaspreet Singh Ghuman

Jassweb.com/

Passionate Professional Blogger, Freelancer, WordPress Enthusiast, Digital Marketer, Web Developer, Server Operator, Networking Expert. Empowering online presence with diverse skills.

jassweb logo

Jassweb always keeps its services up-to-date with the latest trends in the market, providing its customers all over the world with high-end and easily extensible internet, intranet, and extranet products.

Contact
San Vito Al Tagliamento 33078
Pordenone Italy
Item added to cart.
0 items - 0.00
Open chat
Scan the code
Hello 👋
Can we help you?