“ipconfig /flushdns” – Reset 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 resetting or flushing the DNS cache. The flush DNS will clear all previous cache and entries about IP address and domain name resolution.

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.

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 DNS cache is flushed succesfully 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.

READ  mstsc Command Tutorial - Connect RDP (Remote Desktop Connections)

OS X 10.10 and later

sudo discoveryutil mdnsflushcache

OS X 10.7 – 10.9

sudo killall -HUP mDNSResponder

OS X 10.6 and before

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.

dnsmasq

$ sudo /etc/init.d/dnsmasq restart

pdnsd

$ sudo pdnsd-ctl empty-cache

nscd

$ sudo /etc/init.d/nscd restart

dns-clean

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

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

Leave a Comment