How to clear the DNS Server and Client Caches to Remove Bogus IP Addresses

Home > Blogs > Windows Server > How to clear the DNS Server and Client Caches to Remove Bogus IP Addresses

How to clear the DNS Server and Client Caches to Remove Bogus IP Addresses

Like This Blog 3 Mike Danseglio
Added by April 19, 2013

Have you ever had bogus name resolution data in your DNS cache? This happens when you’re pointed to a DNS server with outdated records, or perhaps a misconfigured server. You might see symptoms like all fully-qualified domain names (FQDNs) resolving to the same IP address, or even all FQDNs resolving to 127.0.0.1 (localhost).

Even when you configure clients and servers to use a properly configured DNS server they will retain previously resolved DNS addresses. The DNS resolution data is usually cached on both the client computer and the DNS server. So until the cache expiration time expires you will continue to see bogus name resolution results.

If you’re using Windows there are quick ways to purge the DNS cache on the client and on the server. I suggest you start with the server.

Purging the DNS Server Cache on a Windows DNS Server
If you’re using Windows Server 2003, Windows Server 2008, or Windows Server 2012 as your DNS server you can easily purge the server-side DNS cache using either a command-line tool or Windows PowerShell.

Purging the DNS Server Cache From the Command Prompt
At the command prompt, run the following command:

Dnscmd /ClearCache

Purging the DNS Server Cache With Windows PowerShell
To clear the DNS server cache using Windows PowerShell, use the following cmdlet from the dnsserver module:

Clear-DnsServerCache

Purging the DNS Cache on Windows Clients
This command purges the DNS client (or resolver) cache on Windows XP, Windows 7, and Windows 8, as well as Windows 2000, Windows Server 2003, Windows Server 2008, and Windows Server 2012.

At a command prompt, run the following command:

Ipconfig /FlushDNS

I hope this helps you resolve DNS resolution issues without needlessly rebooting computers to purge the cache.

Enjoy!

Mike Danseglio -CISSP / CEH
Interface Technical Training – Technical Director and Instructor

Videos You May Like

Identifying and Fixing Misconfigured Subnet Masks in Your Network Environment

0 352 1

In this video, Cisco CCNA instructor Mark Jacob show how to find and fix misconfigured subnet masks in a typical IT network environment.   Mark Jacob Cisco and CompTIA Network + Instructor – Interface Technical Training Phoenix, AZ

How to clone a Windows Server 2012 or 2012 R2 Domain Controller

3 1482 3

One of the coolest new features in Window Server 2012 and Windows Server 2012 R2 is the ability to clone a Domain Controller. In the past, if we had virtualized Domain Controllers and we actually took a snapshot of it and then rolled back to that snapshot, it would break the logon service on that … Continue reading How to clone a Windows Server 2012 or 2012 R2 Domain Controller

Detailed Forensic Investigation of Malware Infections – April 21, 2015

4 608 5

How does an investigator hunt down and identify unknown malware? In this recording of our IT Security training webinar on April 21, 2015, Security expert Mike Danseglio (CISSP / CEH) performed several malware investigations on infected computers and identify symptoms, find root cause, and follow the leads to determine what’s happening. He demonstrated his preferred … Continue reading Detailed Forensic Investigation of Malware Infections – April 21, 2015

Write a Comment

See what people are saying...

  1. Avatar Lanora Sotolongo

    you have brought up a very superb points, regards for the post.

  2. Avatar Shalini

    I want to clear my DNS server please

  3. Avatar Alex

    I have SBS2011 and none of the above-mentioned commands are available neither under CMD or PowerShell
    I have DNS/DNS management tools feature installed.

Share your thoughts...

Please fill out the comment form below to post a reply.