Skip to content

Instantly share code, notes, and snippets.

@shulard
Last active March 3, 2020 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shulard/dd03fc0fa31acefa5a62 to your computer and use it in GitHub Desktop.
Save shulard/dd03fc0fa31acefa5a62 to your computer and use it in GitHub Desktop.
Script d'installation et configuration de DNSMasq sur Mac OS pour rediriger tous les .localhost vers 127.0.0.1
#Installation avec Homebrew
brew update
brew install dnsmasq
#Mise en place de la configuration et ajout des règle
cp $(brew list dnsmasq | grep /dnsmasq.conf.example$) /usr/local/etc/dnsmasq.conf
sed -i '' -e "/\#address=\/double-click\.net\/127\.0\.0\.1/a\\
address=/.localhost/127.0.0.1" /usr/local/etc/dnsmasq.conf
#Démarrage du daemon
sudo cp -fv /usr/local/opt/dnsmasq/*.plist /Library/LaunchDaemons/
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
#Configuration du système pour router les `.localhost` vers le nouveau serveur DNS
sudo mkdir -p /etc/resolver
sudo tee /etc/resolver/localhost >/dev/null <<EOF
nameserver 127.0.0.1
EOF
@shulard
Copy link
Author

shulard commented Feb 27, 2016

Plus de détails sur la procédure d'installation ici: http://www.chstudio.fr/2016/02/comment-en-finir-avec-ledition-du-fichier-hosts/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment