How to flush/clear the pfsense DNS forwarder cache

Posted on in Categories , last updated April 18, 2017

I am using the pfSense based firewall. How do I clear the unbound DNS forwarder cache when using the pfSense firewall?

Your firewall comes with Unbound DNS caching system. It is a very secure validating, recursive, and caching DNS server. This tutorial shows you how to clear the Unbound DNS forwarder cache, restart the Unbound daemon on pfSense.

How do I clear or flush the DNS cache

Fire a web-browser and type your firewall IP-address or hostname. For example:
Next click on the Status > Services:

Fig.01: See pfsense services
Fig.01: See pfsense services

Locate unbound in the list:
Fig.02: Clear the DNS cache
Fig.02: Clear the DNS cache

Click on “restart” icon.


From your Linux/Unix/FreeBSD workstation type the host command:
$ host domain pfsense-firewall-ip-here
$ host

Sample outputs:

Using domain server:
Aliases: is an alias for has address

Please note that most modern browser may cache dns queries too. So just restart your browser too.

How do I clear/flush the MS-Windows 7/10 client DNS cache?

Open Command Prompt from the run box (Press Windows+R and type “cmd” and then click “OK”). Type the following command at C: prompt:
ipconfig /flushdns

How do I clear/flush the macOS sierra client DNS cache?

Open the terminal app and type the following two commands:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

How do I clear/flush the Linux client DNS cache?

See “How To Flush Linux / UNIX DNS Cache” for more info.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

2 comment

Leave a Comment