Script d'installation et configuration de DNSMasq sur Mac OS pour rediriger tous les .localhost vers 127.0.0.1
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
#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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/