Skip to content

Instantly share code, notes, and snippets.

@outloudvi
Created March 12, 2018 15:33
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 outloudvi/cb5ad8c9cb06853e851444284d927cd8 to your computer and use it in GitHub Desktop.
Save outloudvi/cb5ad8c9cb06853e851444284d927cd8 to your computer and use it in GitHub Desktop.
Mastodon hosts fix
#!/bin/bash
# mastohosts.sh, released to Public Domain
## 'sudo bash mastohosts.sh >> /etc/hosts' or something else
## and flush your DNS cache.
DNS=8.8.8.8 # Select your DNS,
HOSTS=(
"cmx.im"
"media.cmx.im"
"mastodon.social"
"files.mastodon.social"
"mastodon.host"
"toots.social"
for i in ${HOSTS[*]}
do
echo $i $(dig $i @$DNS +short | sed '2,$d')
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment