Skip to content

Instantly share code, notes, and snippets.

@libern
Forked from craigvantonder/flush-dns.sh
Created November 27, 2017 08:50
Show Gist options
  • Save libern/4a931d1699ede4a7ca9a275e31055584 to your computer and use it in GitHub Desktop.
Save libern/4a931d1699ede4a7ca9a275e31055584 to your computer and use it in GitHub Desktop.
Flushing the DNS in Ubuntu 16.04
#!/bin/bash
# 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