Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

DNS Cache

DNS Cache

DNS Cache (Windows)

ipconfig /displaydns
net stop dnscache
net start dnscache
ipconfig /flushdns
Get-DnsClientCache
Get-DnsClientServerAddress

DNS Cache (Linux)

DNS is cached at multiple levels. If you know the cache has been flushed on the local device through tools on that OS, then you can look at the upstream. Here are some tools you might find on linux that will help you purge the local cache:

Look in the /etc/resolv.conf to see which dns software is running on the machine, then you can use various tools to reset based on the dns software it is running:

sudo dhclient
sudo service network-manager restart

For newest versions of Debian/Ubuntu

sudo resolvectl flush-caches

For newer versions of Debian/Ubuntu

sudo systemd-resolve --statistics
sudo systemd-resolve --flush-caches

If running nscd

sudo /etc/init.d/nscd reload # nscd 
sudo nscd -g
sudo nscd -i hosts
sudo /etc/init.d/nscd restart

For older versions of debian/ubuntu

sudo service dnsmasq restart

For bind

sudo rndc flush
sudo /etc/init.d/named restart # bind9