2

I want to know if my local computer works as DNS server.

I mean, when it tries to resolve internet addresses does it first look in it? Like, is there a DNS cache in Windows 7 or the internet browser? Or does it start to ask the router that works as a DNS cache?

Please, I want a full description how this works because I'm confused where the DNS resolving process start.

  • Yes your computer stores a local dns cache. You can clear it by using ipconfig /flushdns in windows using Administrator privilages. Use sudo dscacheutil -flushcache for MacOS. On linux it changes depending on the daemon you are using but usially you either use a similar flush command or restart/reload the daemon. – Roh_mish May 10 '16 at 7:52
  • thanks a lot , so the computer stores the dns cache not the browser right ?! then (in case it didn't found the result ) it forwards the request to router dns and so on .. – Wissam A Jackal May 10 '16 at 7:59
  • Chrome too stores local cache which you can clear by going to chrome://net-internals/#dns and then Clear host cache – Roh_mish May 10 '16 at 8:11
  • Chrome looks at its own cache, if it cant find a record it moves on to your PCs local cache and then the router to your ISPs DNS if you use that and up the chain till it finds a matching record. – Roh_mish May 10 '16 at 8:12
  • thanks a lot my friend , one last thing , DNS refer to Domain Name System (or Service or Server) right ?! all the three are the same ? – Wissam A Jackal May 17 '16 at 7:36
8

Your machine will always check its local cache first to save having to ask a DNS server a question that it already knows the answer to. You can see this by opening a command prompt and running the following command:

ipconfig /displaydns

local DNS Cache


if your machine cannot get an answer from your DNS cache, it will ask it's primary DNS server, which will in turn check it's own database and give you a reply. For home users, it is most likely your router. You can find your DNS server by running the following command:

ipconfig /all

enter image description here


If there is no reply from your primary DNS, your computer will ask it's secondary DNS (if you have one configured) and then it's third and then it's fourth.. and so on.

If your primary DNS is online but doesn't have the answer, it will in turn ask it's own primary DNS (probably your ISP for most home users). Your ISP will then check its own DNS and serve a reply to your router which will serve it to you.

If your ISP DNS doesn't have the record, it will start asking it's configured roots or forwarders. These are a list of places configured inside DNS that are used when the DNS server itself doesn't know where to get an answer from. These are typically other DNS Servers, or internet root name servers.


Further Reading:

How DNS query works

Domain Name System - Hill Associates

DNS Namespaces - Google (particularly look at the Namespaces section)


Diagnosing DNS problems

Some applications store their own DNS cache. Web browsers are a prime example of this. As there are billions of applications in the world, millions of which (possibly) store a DNS cache - I'm not going to start listing possible ways to flush it. If you suspect an address is being cached - prove it (example - chrome fails to resolve a site name but Firefox is OK - it may be a chrome cache issue) and then google how to clear cache for that specific application.

NSLOOKUP www.google.com - this command (when entered into a command prompt) will give you a DNS lookup for www.google.com and return its ip: enter image description here

IPCONFIG /flushdns - this command will flush your local DNS cache and help get rid of any bad results you have stored locallyenter image description here

Lastly, if you are getting poor name resolution or lots of lookup failures from your ISP, there are loads of alternative DNS servers you can add to your router or PC to do name resolution more reliably. Although I use my corporate DNS servers and ISP for most of my stuff, the google DNS service is pretty good. Check out this link for more info

(lastly, apologies for the poor screenshots - I'm at work and can't post better ones without blanking out most of the data - I found these on the net)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.