Flush local DNS cache on a browser and local system

Browser(application) level:

For Google Chrome/Chromium, open the link below:
chrome://net-internals/#dns
and click “Clear host cache

For Firefox, open the link below:
about:config
then click “I’ll be careful, I promise!“,
and find network.dnsCacheExpiration, set its value to 0 (create one if it didn’t exist).
Now the cache should be flushed, and set network.dnsCacheExpiration back to 3600, or you the cache will not work at all.

Operating system level:

  • Windows:
    • ipconfig /flushdns
  • Linux:
    Depends on the dns service you are using: 
    • sudo systemd-resolve --flush-caches
    • sudo /etc/init.d/dns-clean restart
    • sudo /etc/init.d/nscd restart
    • sudo /etc/init.d/dnsmasq restart
    • sudo /etc/init.d/named restart
  • macOS (> v10.5):
    • dscacheutil -flushcache