From 2d18b7027b620253ffacc32706e9adc3cfa1a410 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Thu, 26 Mar 2015 18:10:32 +0000 Subject: [PATCH] Added a script to flush the DNS on any OS. Needs work. --- bin/flush-dns | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 bin/flush-dns diff --git a/bin/flush-dns b/bin/flush-dns new file mode 100755 index 0000000..a679348 --- /dev/null +++ b/bin/flush-dns @@ -0,0 +1,24 @@ +OS=$(uname -s) +REL=$(uname -r) + +function sorry() +{ + echo "Sorry. I do not know how to flush the DNS on this OS." + echo "Once you find out, edit $(readlink ${0})." + exit 1 +} + +case ${OS} in + Darwin) case ${REL} in + 14.1.0) sudo discoveryutil udnsflushcaches + ;; + *) sorry + ;; + esac + ;; + + *) sorry + ;; +esac + +exit 0