When a system DNS works for a long time, it saves many records that cause DNS works slowly or not working correctly. To flush DNS cache, you need to clear DNS records from your system. You can do it with the command line in command prompt and Windows Powershell and Terminal on macOS systems.
The flush DNS command is the tool you need to clear and flush DNS cache. Just open the command line interface and dump the correct DNS cache then remove it.
The Domain Name System (DNS) is a hierarchical decentralized naming system for computers, services, or other resources connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates more readily memorized domain names to the numerical IP addresses needed for locating and identifying computer services and devices with the underlying network protocols.
Clear and Flush DNS Cache with the command line:
Ipconfig /flushdns For Mac
Sep 29, 2020 In the command line interface, run ipconfig /flushdns. You should receive a confirmation message once the DNS cache is flushed. How to Clear DNS Cache on Linux. Flushing your DNS cache on Linux machines is fairly similar to the process of doing so on a Mac or Windows computer. Jan 08, 2019 Clear DNS Cache on a Mac. Flush DNS on macOS Mojave (version 10.14). Type ipconfig /flushdns when the prompt loads and hit Enter on the keyboard.
- Open a command-line interface
- Display DNS Records
- Flush DNS Cache
- Check DNS Records
To flush DNS cache just follow the step by step guide. It works the same on all Windows operating systems, but different on various macOS and Linux distributions.
Related:Install and Configure DNS Server on Windows Server.
How to View DNS Cache
To view DNS cache on Windows systems, just type “ipconfig /displaydns” in command prompt.
Ipconfig Flushdns For Mac
- Press Windows+R to open the Run.
- Type “cmd” and press enter to open the command prompt.
- Now type “ipconfig /displaydns” to view DNS cache and records.
The ipconfig /displaydns result is like this.
There are too many DNS records on my system. But this is just an example of DNS cache in Windows system.
Flush DNS Cache in Windows 10
To clear Windows 10 DNS cache and records, type the “ipconfig /flushdns” command in command prompt or PowerShell.
That’s good, the DNS cache removed successfully. This command works the same on all Windows client and Windows server machines.
Check DNS Records
Now if you check again you can not find any DNS records.
Yes, the system can not display the DNS records. Because there is no DNS record cached yet.
Flush DNS Cache on macOS
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. For the different version of macOS operating system use the following command to clear and flush DNS cache.
macOS Sierra, OS X El Capitan, Mac OS X Yosemite, Mac OS X Mavericks, Mac OS X Mountain Lion, Mac OS X Mountain Lion, and Mac OS X Lion.
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 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
Flush DNS Cache on Linux
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
- Now, you just have to restart the NSCD. To do, type the following command
Finally, ask your question related to the DNS server from the comment section.