How To Find DNS Server IP Address of a Website
Every domain or website has at least two authoritative name servers where the records are kept. These name servers are responsible for handling DNS on behalf of the domain name.
To find DNS server IP addresses of a website, an administrator can use either the nslookup or dig
command.
The record type we need to query is NS
(nameservers). The following two examples show how to use nslookup
and dig
to query NS
record for a domain:
nslookup -type=ns domain_name
dig ns domain_name
The output of either command will be the name of two or more authoritative name servers.
Then to find the IP address by domain name, query for A
(Pv4 address) and AAAA
(IPv6 address) record types. The nslookup
command, without any options, returns both the IPv4 address and IPv6 address for a domain or website name.
nslookup domain_name
The following example shows how to use nslookup
to find the nameservers for a domain name:
In our example, first, we looked for the NS
record type using the nslookup
command. The command shows us the name of two DNS Servers. After that, we ran two separate queries to find the IP Address of the two DNS Servers.
The following example shows how to do the same thing using the dig
command:
In the above example, the +short
parameter was used to show the answer without additional data.