As I understand after a Domain Name is resolved to a specefic IP through DNS www.example.com resolves to, this cache is saved in RAM in a computer for a little bit, AKA five or so minutes. (Note: Correct me if I'm wrong)

So, when I DNS spoof a computer to resolve www.whatevs.com to the IP of my website clone running on my local apache server: . Then it does what it does and it is finished. But, the problem is after the attack is finished and I stop DNSSpoofing, the computer saves www.whatevs.com to for a little while after, before it runs a DNS resolution lookup again to resolve the real IP. Does anyone know how to stop this by making the computer lose the cache, or forget www.whatevs.com's fake IP address, so it must re-resolve it? Thanks!

2 Answers 2


DNS TTL is used to decide how long we want the entry to be cached on the local machine. Advertise smaller TTL (DNS server/Responder does this) so that the entry will be flushed at the configured time :-)

Try it out. Its fun.

Good luck.


It's not the computer's RAM, its the DNS cache where this info is held, and it's held there till it expires. I believe the default (on Windows) is 1 day.

To purge it earlier, run (on victim machine):

  • Windows: ipconfig /flushdns
  • Linux (various, google for specific version)
  • OSX - sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder

Note: Don't forget to purge the DNS cache on any upstream DNS Servers you may have poisoned as well, if necessary.

  • Could I just set the TTL (Time To Live) to one second that way after they do the 'bad activity' the DNS is never cached, it must be re-resolved directly after?
    – Creg
    Commented Oct 17, 2016 at 13:00
  • In theory, but I would test it to be sure
    – HashHazard
    Commented Oct 17, 2016 at 14:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .