HowTo: Find Out DNS Server IP Address Used By My Router?

by on April 24, 2012 · 15 comments· LAST UPDATED August 31, 2013

in , , ,

My router configured by ISP tech and it is set to get DNS server address automatically from upstream. Is there is a way to find out the IP address of the dns server used by my router which is located at 192.168.1.1? Is there Linux, Unix, Apple OS X, or MS-Windows command that I can use get the same information?

Domain Name System (DNS) is an Internet service that translates domain names into IP addresses or vice versa.
Tutorial details
DifficultyIntermediate (rss)
Root privilegesNo
RequirementsNone
Estimated completion time5m
The easiest way to find out your dns server IP address is to go through the router's admin interface status page. All routers have a built-in web-based setup page that allows the user to customize settings and set view properties such as IP address and dns settings.

Method #1: Router's Webgui Status Page (Recommended for all users)

You can use router's web gui page to find out dns server IP address assigned by your ISP.

  • First, open a web browser (use your computer’s web browser such as Firefox, Google Chrome, or Internet Explorer).
  • Type the router's IP address on the Address bar on top then press Return ([Enter] key] on your keyboard. In most cases the router's default IP address is 192.168.1.1 (see how to find out router's IP address under MS-Windows and Unix like operating system).
  • Enter your router's username and password when prompted.
  • You should see router page like the one below (the page varies depending on the router make and model).
What Is My Router's DNS Server IP Address?

Fig.01: My linksys home router

  • Finally, click on Status to view dns address assigned by your ISP. You should see status page like one below (again page output varies on the router make and model but you should able to see dns server IP address)
Find out my Cisco / Linksys Router's ISP DNS Server IP Address

Fig.02: My linksys router's dns server settings assinged by my isp

Method # 2: MS-Windows Commands

Open a command prompt (click on Start > run > type cmd and press [enter] key to open a command prompt).

Type the nslookup command to check DNS resolution at the command prompt c:>
nslookup www.cyberciti.biz
OR
nslookup www.google.com
Sample outputs:

nslookup www.cyberciti.biz
Server:		dns2.mumbai.corp-lan.nixcraft.net.in
Address:	10.0.80.11#53
Non-authoritative answer:
Name:	www.cyberciti.biz
Address: 75.126.153.206

The first two lines are the dns server (10.0.10.11 or dns2.mumbai.corp-lan.nixcraft.net.in) you are using i.e. dns server IP address assigned by your ISP or network admin. 10.0.80.11 is our own dns server located inside our corporate network.

Say hello to ipconfig /all command

Another option is to type ipconfig /all command at the command prompt to get the same information:
ipconfig /all
Sample outputs:

Fig.03: MS-Windows command to find out DNS server IP addresses

Fig.03: MS-Windows command to find out DNS server IP addresses


In this example my DNS server is located at 192.168.1.2. This one is used by my computer, and it was passed on to my computer by ISP modem / router.

Method #3: Apple OS X or Unix / Linux Commands

Open the bash shell prompt and type the dig or host commands:
$ host -a www.cyberciti.biz | grep from
Sample outputs:

Received 229 bytes from 10.0.10.11#53 in 0 ms

OR use the dig command:
$ dig www.cyberciti.biz | grep SERVER
Sample outputs:

;; SERVER: 10.0.10.11#53(10.0.10.11)

However, a better approach is to go through /etc/resolv.conf file to see assigned dns server address to your computer. It was passed on to you by your modem / router:
$ cat /etc/resolv.conf
Sample outputs:

nameserver 10.0.80.11
nameserver 10.0.80.12
options single-request

(Fig.04: 10.0.80.11 and 10.0.80.12 are my DNS server IP address assigned under Unix like operating systems)

Method #4: Dump and view traffic on a network (recommended for advanced users only)

You can use the tcpdump command to dump traffic on a network and view dns traffic. tcpdump command works on most Unix-like operating systems. tcpdump command analyzes network behavior, performance and applications that generate or receive network traffic including dns traffic. To view dns traffic only run tcpudmp as root user in a separate window:
# tcpdump udp and src port 53
# tcpdump udp and dst port 53
# tcpdump -n -s 1500 -i eth0 udp port 53

Open another window (terminal) and run host / dig commands to generate dns traffic:
$ host www.cyberciti.biz
Sample outputs:

Unix / Linux: Tcpdump Monitor UDP Port 53 DNS Traffic

Fig.05: Tcpdump in action - monitoring udp port # 53 traffic


In this example:

  1. You see all packets going in and out of my Linux system for udp port # 53.
  2. I ran host command from another windows.
  3. The output of tcpdump clearly indicate that my computer (IP:192.168.1.5) asking to dns server (IP:192.168.1.2) about the address of www.cyberciti.biz? In second line I got answer from dns server.
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 15 comments… read them below or add one }

1 Bangolio April 24, 2012 at 9:33 pm

Don’t take this the wrong way since I really love this website but:
1. This is not *nix related which is fairly disappointing.
2. Some home routers work as a cache DNS; They issue queries to the DNS servers, cache the result and send it back to you.
3. Since you wrote it anyway, I would add some free public DNS addresses (ie OpenDNS, Google, Symantec etc).

Reply

2 nixCraft April 24, 2012 at 9:40 pm

Yes, I know. I get this question asked way too often. So, I decided to add it to our FAQ section. Don’t worry, I’m not switching to other oses.

I appreciate your comment.

Reply

3 Bangolio April 24, 2012 at 11:32 pm

Thanks man, you’re awesome and this site is great!

Reply

4 ttt April 25, 2012 at 12:01 pm

tcpdump, dig, host and other commands are *nix specific. Isn’t it?

Reply

5 Scott April 26, 2012 at 11:01 pm

This is very relevant to Linux/Unix. Carry on! Great blog,

Reply

6 Bangolio April 27, 2012 at 12:58 pm

Part of it is relevant to *nix, I was just saying that part of it isn’t as there is a Windows section and a router section.
I don’t have anything specifically against that, I was merely pointing out that it’s not relevant to the site.
It’s not that big of a deal but imagine if this post was about DNS facilities in Linux and you had explanations about the dnsdomainname command, hosts file, hostname command, resolv.conf (explaning the useful search domain feature and options) and so on, that would be a lot more appropriate.

But again, it’s not like this is hurting anyone, Vivek said he posted this because he was getting this question too much so that’s good.

Reply

7 Wendy Merritt July 7, 2012 at 10:32 pm

I had been searching for this information for this information for a few minutes. Thanks for having exactly what I needed! Awesome! I am back in business now!

Reply

8 john doe August 21, 2013 at 9:03 am

thanks for the info menh you were of extreme help in ma project thanks again

Reply

9 Allen Ellison August 31, 2013 at 6:34 am

Above you mention the Mac OS X resolv.con file. It is actually called resolv.conf

Reply

10 nixCraft August 31, 2013 at 8:08 am

Thanks for the heads up!

Reply

11 Rick January 9, 2014 at 3:48 am

What if Method #1 and #2 give different IP addresses? I have a 2Wire router with AT&T U-verse and from the routers status page I get the following (from under Settings->Broadband->Status:
Subnet Mask 255.255.252.0
Default Gateway 75.16.180.1
Primary DNS 68.94.156.1
Secondary DNS 68.94.157.1

From the windows cmd ipconfig /all this is what I get:
Subnet Mask 255.255.255.0
Default Gateway 192.168.1.254
DNS Servers 192.168.1.254 (same as above)

All the addresses are different in both versions. Which one is correct and why are they giving numbers?

Reply

12 Rick January 9, 2014 at 3:49 am

I meant “why are they giving different numbers?”

Reply

13 Nix Craft January 9, 2014 at 6:01 am

Your 2Wire router router act as all-in-one gateway server. It has in-built caching dns server and it is used to speed up dns queries. It also saves load on remote ISP dns server such as 68.94.156.1 and 68.94.157.1.

Reply

14 bradley naveau March 25, 2014 at 7:30 am

i needed to find out how to find my computers dns server but all the forums and help already expected me to know the dns server, how do i find this information in my computer. thanks for any replies and if not this site is a waste of time.

Reply

15 finite9 April 11, 2014 at 10:32 am

I run a pfSense router and Fedora client. When I use dig or cat resolv.conf, i’m only getting the router IP, not the actual DNS server used.

I can see which DNS IP’s i’ve configured in pfSense, but how to I actually verify that they are being used?

Do I have to ssh into the router and cat resolv.conf there? (cannot try this at mo, cuz i dont have remote admin enabled)

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: