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
command line which will list the Command Prompt. There you will see the
Run as administrator to open the command prompt with Administrator privileges.
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.
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
command line into the start menu and right-click right to the
Command Prompt and select the
Run as administrator.
We will type the
ipconfig /flushdns command like below and then press enter in order to reset or flush the DNS cache.
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
Terminal . and then use the following commands for the related MacOSX version.
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.
$ sudo /etc/init.d/dnsmasq restart
$ sudo pdnsd-ctl empty-cache
$ sudo /etc/init.d/nscd restart
$ sudo /etc/init.d/dns-clean restart