Last active
February 3, 2021 04:42
-
-
Save craigvantonder/e9ee426f4108094d56e76ba1f756035e to your computer and use it in GitHub Desktop.
Flushing the DNS in Ubuntu 16.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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!"; | |
# Output: | |
# craig@laptop:~$ sh Desktop/Scripts/flush-dns.sh | |
# [sudo] password for craig: | |
# [ ok ] Reloading networking configuration (via systemctl): networking.service. | |
# [ ok ] Restarting nscd (via systemctl): nscd.service. | |
# DNS Flushed! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had ERR_NAME_NOT_RESOLVED Error in Chrome.
sudo /etc/init.d/dns-clean restart
helped. Thanks