aboutsummaryrefslogtreecommitdiff
path: root/source/notes/2016-12-12-dns.md
blob: a78e2855aa95f59f0ce35e9c6ca8c1778393ce81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
title: "dns"
date: 2016-12-12T09:14:00
date_display: Dec 12, 2016
---

Désactiver la reconfiguration auto du fichier de conf de netcl `/etc/NetworkManager/NetworkManager.conf` :

```sh
dhcp=none
```

PS : d'autres option disponible sur le [Wiki d'archlinux](https://wiki.archlinux.org/index.php/resolv.conf).
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
```