diff options
author | neodarz <neodarz@neodarz.net> | 2018-03-26 15:35:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-03-26 15:35:34 +0200 |
commit | ddcf54c82dbec25c47ff2a99429df75b1ee5b6ca (patch) | |
tree | c3ba2ab7530eabc0f5dc7ee892dd10f70f7e7683 | |
parent | cc0100f078f4d03560afe0aa451a8e7c8d771c50 (diff) | |
download | my_new_personal_website-ddcf54c82dbec25c47ff2a99429df75b1ee5b6ca.tar.xz my_new_personal_website-ddcf54c82dbec25c47ff2a99429df75b1ee5b6ca.zip |
Add dnsmasq doc for dev env
-rw-r--r-- | source/notes/2016-12-12-dns.md | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/source/notes/2016-12-12-dns.md b/source/notes/2016-12-12-dns.md index 5e496b84..a78e2855 100644 --- a/source/notes/2016-12-12-dns.md +++ b/source/notes/2016-12-12-dns.md @@ -15,3 +15,48 @@ Puis reboot. Changer le DNS, edit `/etc/resolv.conf` par ceux de [fdn](https://www.fdn.fr/actions/dns/) (par exemple). + +# Environnement de dev + +Pour avoir un environnement de dev avec un tld comme `.lan`, `.dev` ou +encore `.local` il faut installer un dns local afin de ne pas se casser la tête +pour chaque site à ajouter dans le `/etc/hosts`. + +Dnsmasq permet de régler ce problème. Exemple de fichier de conf: + +``` +# Never forward plain names (without a dot or domain part) +domain-needed +# Never forward addresses in the non-routed address spaces. +bogus-priv + +# If you don't want dnsmasq to read /etc/resolv.conf or any other +# file, getting its servers from this file instead (see below), then +# uncomment this. +no-resolv + +# Add other name servers here, with domain specs if they are for +# non-public domains. +#server=/localnet/192.168.0.1 +server=80.67.169.12 +server=80.67.169.40 + +# Add local-only domains here, queries in these domains are answered +# from /etc/hosts or DHCP only. +#local=/localnet/ + +# Add domains which you want to force to an IP address here. +# The example below send any host in double-click.net to a local +# web-server. +#address=/double-click.net/127.0.0.1 +address=/lan/127.0.0.1 +``` + +Il faut aussi indiquer dans le `/etc/resolv.conf` qu'il faut utiliser le DNS +local. Configuration de `resolv.conf`: + +``` +# If you run a local name server, you should uncomment the below line and +# configure your subscribers configuration files below. +name_servers=127.0.0.1 +``` |