From ddcf54c82dbec25c47ff2a99429df75b1ee5b6ca Mon Sep 17 00:00:00 2001
From: neodarz <neodarz@neodarz.net>
Date: Mon, 26 Mar 2018 15:35:34 +0200
Subject: Add dnsmasq doc for dev env

---
 source/notes/2016-12-12-dns.md | 45 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

(limited to 'source')

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
+```
-- 
cgit v1.2.1