How to Find My DNS Server IP ADDRESS in Linux

This post will guide you how to find out my DNS Server IP ADDRESS in your Linux system. How to find a given website DNS Server IP address from the command line in Linux operating system.

find dns server ip address1

What is DNS?


The Domain Name System (DNS) is a hierarchical decentralized naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities.

Find My DNS Server IP Address


If you want to find out your DNS Server IP Address in your Linux server, and you can use the following cat command, type:

$ cat /etc/resolv.conf

Or

$ less /etc/resolv.conf

Outputs:

[devops@~]# cat /etc/resolv.conf
; generated by /usr/sbin/dhclient-script
nameserver 108.61.10.10

You can also use grep command to filter out your DNS Server IP Address, just type the following command:

$ grep "nameserver" /etc/resolv.conf

Outputs:

[devops@~]# grep "nameserver" /etc/resolv.conf
nameserver 108.61.10.10

Find a Website DNS Server IP Address


If you want to find out a given website DNS Server IP address, for example, you want to get the DNS IP Address of bing.com, you can use the following dig command, type:

$ dig bing.com

Outputs:

devops@devops:~$ dig bing.com

; <<>> DiG 9.11.3-1ubuntu1.8-Ubuntu <<>> bing.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58296
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;bing.com. IN A

;; ANSWER SECTION:
bing.com. 1333 IN A 13.107.21.200
bing.com. 1333 IN A 204.79.197.200

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Tue Sep 10 09:08:46 EDT 2019
;; MSG SIZE rcvd: 69

If you are working on a Windows system, and you wish to find out the DNS IP address, and you can use the following command in your command line of windows system, type:

C:\Users\devops> ipconfig /all

 

You might also like:

Sidebar



back to top