Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've consistently had a problem where "ipconfig /flushdns" + restarting computer doesn't get rid of all the DNS records.

Should it completely flush any and all records in DNS?
Why doesn't it usually happen like this?
Is there some kind of restriction?

share|improve this question
1  
You have some good answers to your hypothetical question. What problem are you trying to overcome? –  dbasnett Jul 25 '13 at 15:03

2 Answers 2

up vote 9 down vote accepted

The question is unclear, so I'll interpret it literally.

It is physically impossible to flush all records in DNS, because DNS – the Domain Name System – is hosted on many servers over the entire Internet, and you would have to destroy all of them.

What ipconfig accesses is your computer's local cache of information looked up from DNS; if you flush the cache on your computer and try to access any domain, the computer has to ask the configured DNS server again.

However, the configured DNS server, be it your router's, your ISP's, or a public one (e.g. Google's), has its own cache. Once someone asks the DNS server at 8.8.8.8 about the domain superuser.com, it gets cached on that server as well. So in many cases there might be three, maybe even four, layers of caching: in Windows, in your router/modem/gateway, at your ISP, and maybe a second layer deeper at the ISP.

This would be the answer, if one asked "why, after I change something in my domain and run /flushdns, I still don't see my changes?"


On the other hand, if one asked "why do some entries remain in ipconfig /displaydns even after I have flushed them with /flushdns?", it would have several possible answers:

  1. A program is repeatedly resolving some domain, so its information gets cached almost immediately again.
  2. The DNS Resolver has the handling of some special names hardcoded (such as localhost).
  3. The DNS Resolver automatically reads your /etc/hosts (actually %SystemRoot%\system32\drivers\etc\hosts) and uses it to fill the Resolver cache so that these names wouldn't have to be actually looked up on DNS. It's a nice trick to avoid re-reading /etc/hosts every time a name has to be resolved.
share|improve this answer
    
So then by releasing your ip ipconfig /release and ipconfig /renew you're essentially getting a new IP assigned that other DNS servers do not recognize? –  Howdy_McGee Jul 25 '13 at 18:01
    
@Howdy_McGee: These two commands have no relation at all to the ones explained above. They do not do anything to DNS; they work with DHCP – /release "returns" the current IP address lease, and /renew tries to extend the current one – or requests a new one, possibly with a different IP address or with different DNS server settings, but it's up to the router what address it issues a lease for. –  grawity Jul 25 '13 at 18:48

Any A (host) records will be re-added to your cache upon restarting your machine.

Stopping and starting the dnscache will not change this either. Some Host records will automatically repopulate.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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