HomeLinuxEasy methods to Discover My DNS Server IP Deal with in Linux

Easy methods to Discover My DNS Server IP Deal with in Linux


DNS (Area Title System) is a basic facilitator of a number of networking applied sciences similar to mail servers, Web looking, and streaming companies e.g. Netflix and Spotify, amongst others.

It really works on a particular pc known as a DNS server – which retains a database report of a number of public IP addresses together with their corresponding hostnames for it to resolve or translate hostnames to IP addresses upon consumer request.

This occurs in order that we might not must trouble ourselves with remembering the IP addresses of the completely different web sites we go to.

Whereas there are a number of issues we will focus on on DNS servers similar to redirection and malware assault prevention, our focus immediately is on easy methods to discover out your very personal dns server IP handle.

There are a number of methods to test for it relying on the Working System that you simply’re operating however Linux, BSD, and Unix-like techniques all share the identical methodology so let’s start with them.

Easy methods to Discover My DNS Server IP Deal with

1. To seek out out your DNS Server IP handle, use the next cat command or much less command.

$ cat /and so on/resolv.conf
OR
$ much less /and so on/resolv.conf

2. One other manner is to make use of the next grep command.

$ grep "nameserver" /and so on/resolv.conf

nameserver 109.78.164.20

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

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

4. If you happen to’re utilizing NetworkManager, you need to use the nmcli command to get the DNS server data.

$ nmcli dev present | grep 'IP4.DNS'

Right here, nameserver 192.168.0.1 is a reputation server IP handle in what known as the dot notation – the format that purposes in your workstation use for DNS routing.

Find DNS Name Server in Linux
Discover DNS Title Server in Linux

Easy methods to Discover My Web site DNS Server IP Deal with

To seek out out a web site DNS Server IP handle, you need to use the next dig command, which is used to question DNS data.

$ dig tecmint.com
Pattern Output
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.68.rc1.el6_10.1 <<>> tecmint.com
;; world choices: +cmd
;; Received reply:
;; ->>HEADER<<- opcode: QUERY, standing: 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

;; Question 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 offer you an inventory of IP addresses for authoritative nameservers on your web site (i.e., the DNS servers liable for your area).

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

Please notice that the precise IP addresses you obtain could differ relying in your web site internet hosting supplier or area registrar. In case your web site is utilizing third-party DNS companies like Cloudflare or Google Cloud DNS, the IP addresses will probably be particular to these companies.

Straightforward proper? Maybe we’ll speak about main and secondary DNS Server addresses subsequent time. Until then, be happy to share and drop your feedback/options within the dialogue part under.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments