Flush DNS
Most operating systems and DNS clients will automatically cache IP addresses and other DNS results, this is done in order to speed up subsequent requests to the same hostname. Sometimes bad results will be cached and therefore need to be cleared from the cache in order for you to communicate with the host correctly. All major operating systems allow you to force this process. Outlined below are the common steps you will need to follow in order to flush your DNS cache.
Flushing the DNS cache on Windows 10 is a very easy process. Due to system security permissions, you must ensure that you run the command prompt as an administrator user.
- Ensure that you’re on the Windows 10 desktop.
- Right click on the start menu and choose
Command Prompt (Admin)
from the menu. - Type in the command
ipconfig /flushdns
Flushing the DNS cache on Windows 8 and Windows 8.1 is a very easy process. Due to system security permissions, you must ensure that you run the command prompt as an administrator user.
- Ensure that you’re on the Windows 8 Start Screen.
- Simply type
cmd
and the Windows search bar will appear on the right hand side with search results. - Right click on
Command Prompt
and clickRun as administrator
- Type in the command
ipconfig /flushdns
Flushing DNS on newer versions of Windows is almost as easy as the earlier versions but due to Microsoft’s security additions you must run the command prompt with administrator privileges.
- Click the start button and navigate to the command prompt (Start > All Programs > Accessories > Command Prompt)
- Make sure that you right click on the command prompt application and choose “Run as Administrator”
- Type in the command
ipconfig /flushdns
Note: It is also possible to type in cmd
into the Windows Vista / Windows 7 start menu search field and then right click on the cmd.exe result instead of having to navigate through the various sub menus.
Flushing the DNS in Mac OS X is an easy process, but the steps taken will depend on which version of OS X you are running.
macOS Catalina
If you are running Mac OS X 10.15, you need to follow the below steps:
- Open up the command terminal.
- Run the command
sudo killall -HUP mDNSResponder
macOS Mojave
If you are running Mac OS X 10.14, you need to follow the below steps:
- Open up the command terminal.
- Run the command
sudo killall -HUP mDNSResponder
macOS High Sierra
If you are running Mac OS X 10.13, you need to follow the below steps:
- Open up the command terminal.
- Run the command
sudo killall -HUP mDNSResponder
macOS Sierra
If you are running Mac OS X 10.12, you need to follow the below steps:
- Open up the command terminal.
- Run the command
sudo killall -HUP mDNSResponder
Mac OS X El Capitan
If you are running Mac OS X 10.11, you need to follow the below steps:
- Open up the command terminal.
- Run the command
sudo killall -HUP mDNSResponder
Mac OS X Yosemite
If you are running Mac OS X 10.10, you need to follow the below steps:
- Open up the command terminal.
- Run the command
sudo discoveryutil udnsflushcaches
Mac OS X Mavericks
If you are running Mac OS X 10.9, you need to follow the below steps:
- Open up the command terminal.
- Run the command
sudo killall -HUP mDNSResponder
Mac OS X Mountain Lion
If you are running Mac OS X 10.8, you need to follow the below steps:
- Open up the command terminal.
- Run the command
sudo killall -HUP mDNSResponder
Mac OS X Lion
If you are running Mac OS X 10.7, you need to follow the below steps:
- Open up the command terminal.
- Run the command
sudo killall -HUP mDNSResponder
Mac OS X Snow Leopard
If you are running Mac OS X 10.6, you need to follow the below steps:
- Open up a command terminal.
- Run the command
sudo dscacheutil -flushcache
Mac OS X Leopard and below
If you are running Mac OS X 10.5.1 or below, you need to follow the below steps:
- Open a command terminal.
- Run the command
sudo lookupd -flushcache
NSCD – Name Server Cache Daemon
If you are running the nscd Name Service Cache Daemon and wish to flush your DNS cache, then you will need to do the following.
- Open up a command terminal (either as root or run step 2 with
sudo
). - Run the command
/etc/init.d/nscd restart
systemd
If you are running a system that uses systemd, in order to flush your DNS cache then you will need to run the following.
- Open up a command terminal (either as root or run the following with
sudo
). - Run the command
systemd-resolve --flush-caches
- Optional. You can verify that this ran correctly by running the command:
systemd-resolve --statistics