Skip to content

Instantly share code, notes, and snippets.

@vitorspencer
Last active March 10, 2018 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitorspencer/72d6cfda83996d8857fa0a6ebf44fc8e to your computer and use it in GitHub Desktop.
Save vitorspencer/72d6cfda83996d8857fa0a6ebf44fc8e to your computer and use it in GitHub Desktop.
Flush DNS cache Ubuntu 16.04
# !/bin/bash
# NB: First install nscd with sudo apt-get install nscd
# run this command to flush dns cache:
sudo /etc/init.d/dns-clean restart
# or use:
sudo /etc/init.d/networking force-reload
# Flush nscd dns cache:
sudo /etc/init.d/nscd restart
# If you wanted to refresh your settings you could disable and then run
sudo service network-manager restart
echo "DNS Flushed!";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment