Skip to content

Instantly share code, notes, and snippets.

@kgaut
Created February 4, 2020 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kgaut/5a62ba1e272683ce134f6903bc70463b to your computer and use it in GitHub Desktop.
Save kgaut/5a62ba1e272683ce134f6903bc70463b to your computer and use it in GitHub Desktop.
Installation et configuration de dnsmasq pour résoudre les .test et .localhost automatiquement vers 127.0.0.1
####################
# Config dnsmasq
####################
# SEE : https://askubuntu.com/questions/1029882/how-can-i-set-up-local-wildcard-127-0-0-1-domain-resolution-on-18-04
sudo apt-get install dnsmasq
sudo vim /etc/NetworkManager/NetworkManager.conf
# Add the line dns=dnsmasq to the end of [main] section
sudo rm /etc/resolv.conf ; sudo ln -s /var/run/NetworkManager/resolv.conf /etc/resolv.conf
echo 'address=/test/127.0.0.1' | sudo tee /etc/NetworkManager/dnsmasq.d/dot.test-wildcard.conf
echo 'address=/localhost/127.0.0.1' | sudo tee /etc/NetworkManager/dnsmasq.d/dot.localhost-wildcard.conf
sudo service dnsmasq restart
sudo systemctl reload NetworkManager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment