“ipconfig /flushdns” – Reset/Flush DNS Cache In Windows, MacOSX, and Linux

DNS is a protocol used to resolve domain names or web addresses into IP addresses. DNS cache is used to store previously solved domain name – IP address records. Sometimes these DNS cache records can create problems and the best and easiest way to solve this is to reset or flush the DNS cache. The flush DNS will clear all previous cache and entries about IP address and domain name resolution.

Why Flush DNS?

As DNS is an important part of today’s internet and computer network there are different reasons to flush DNS. Some technical problems require flushing DNS in order to solve them.

  • HTTP 404 errors can be solved by flushing the DNS. If the DNS cache is not updated properly or wrong records are stored in the DNS cache this may cause HTTP 404 errors which prevent access to the website.
  • Unable access to the website can be also solved by flushing the DNS cache. Event DNS cache stores previous records to make website access faster is may create problems if there is a change.
  • Keep internet history private as DNS cache stores the old records which provide information to others to learn previously visited websites. This prevents privacy.

Flush DNS Cache For Windows 8, Windows 10, and Windows Server

Windows 8, Windows 10, Windows Server 2012, Windows Server 2016, and Windows Server 2019 use the same infrastructure the same instructions can be used to flush the DNS of these operating systems by using the ipconfig command. Flushing or resetting the DNS cache is an administrative task and to run ipconfig /flushdns the MS-DOS or command line should be opened with Administrator privileges like below.

See also  How To Install and Use WinDiff To Compare Files?

First type the start menu msdos or command line which will list the Command Prompt. There you will see the Run as administrator to open the command prompt with Administrator privileges.

Open MS-DOS/Command Line As Administrator

Now just type the ipconfig /flushdns command like below and press Enter which will execute this command in order to flush or reset the DNS cache.

ipconfig /flushdns

If there is no problem and the DNS cache is flushed successfully the Successfully flushed the DNS Resolver Cache. message will be printed to the command line.

Flush DNS Cache For Windows 7, Windows XP, Windows Server 2003, and Windows Server 2008

Windows 7 and Windows Server 2008 DNS cache flushing is very same as Windows 10, Windows 8. We will open the MS-DOS or command line with administrator privileges. First type msdos or command line into the start menu and right-click right to the Command Prompt and select the Run as administrator.

Open MS-DOS/Command Line as Administrator In Windows 7

We will type the ipconfig /flushdns command like below and then press enter in order to reset or flush the DNS cache.

ipconfig /flushdns

Flush DNS For MacOSX

MacOSX also provides the ability to flush DNS cache. First, you have to close all browsers and then click to the Applications -> Utilities -> Terminal . and then use the following commands for the related MacOSX version.

OS X 10.10 and later

discoveryutils can be used for modern MacOSX operating systems to flush or clear the DNS cache of the operating system.

$ sudo discoveryutil mdnsflushcache

OS X 10.7 – 10.9

The killall command can be used to kill mDNSResponder process which stores DNS records and kills it flush DNS cache.

$ sudo killall -HUP mDNSResponder

OS X 10.6 and before

For older MacOSX operating systems 10.6 and before the dscacheutil can be used to flush DNS cache with the -flushcache option.

$ sudo dscacheutil -flushcache

Flush DNS For Linux, Debian, Ubuntu, Mint, CentOS, RHEL

Actually, Linux distributions do not have a DNS cache mechanism by default but different distributions may store the DNS information with different applications like nscd, pdnsd, dnsmasq. Basically restarting the related service will reset or flush DNS cache.

See also  How To Show/Display File Extensions In Windows?


If you are using dnsmasq use the following command to flush the DNS cache.

$ sudo /etc/init.d/dnsmasq restart


If you are using pdnsd use the following command to flush the DNS cache.

$ sudo pdnsd-ctl empty-cache


If you are using nscd use the following command to flush the DNS cache.

$ sudo /etc/init.d/nscd restart


If you are using dns-clean use the following command to flush the DNS cache.

$ sudo /etc/init.d/dns-clean restart


If you are using bind use the following command to flush DNS cache.

$ sudo /etc/init.d/named restart

1 thought on ““ipconfig /flushdns” – Reset/Flush DNS Cache In Windows, MacOSX, and Linux”

Leave a Comment