-
Notifications
You must be signed in to change notification settings - Fork 641
/
dnsmasq.8
2375 lines (2241 loc) · 119 KB
/
dnsmasq.8
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.TH DNSMASQ 8
.SH NAME
Dnsmasq \- Un serveur DHCP et cache DNS poids-plume.
.SH SYNOPSIS
.B dnsmasq
.I [OPTION]...
.SH "DESCRIPTION"
.BR dnsmasq
est un serveur à faible empreinte mémoire faisant DNS, TFTP, PXE, annonces de
routeurs et DHCP. Il offre à la fois les services DNS et DHCP pour un réseau
local (LAN).
.PP
Dnsmasq accepte les requêtes DNS et y répond soit en utilisant un petit cache
local, soit en effectuant une requête à un serveur DNS récursif externe (par
exemple celui de votre fournisseur d'accès internet). Il charge le contenu du
fichier /etc/hosts afin que les noms locaux n'apparaissant pas dans les DNS
globaux soient tout de même résolus, et assure également la résolution de nom
pour les hôtes présents dans le service DHCP. Il peut aussi agir en temps que
serveur DNS faisant autorité pour un ou plusieurs domaines, permettant à des
noms locaux d'apparaitre dans le DNS global.
.PP
Le serveur DHCP de Dnsmasq supporte les définitions d'adresses statiques et les
réseaux multiples. Il fournit par défaut un jeu raisonnable de paramètres DHCP,
et peut être configuré pour fournir n'importe quelle option DHCP.
Il inclut un serveur TFTP sécurisé en lecture seule permettant le démarrage via
le réseau/PXE de clients DHCP et supporte également le protocole BOOTP. Le
support PXE est complet, et comprend un mode proxy permettant de fournir des
informations PXE aux clients alors que l'allocation d'adresse via DHCP est
effectuée par un autre serveur.
.PP
Le serveur DHCPv6 de dnsmasq possède non seulement les mêmes fonctionnalités
que le serveur DHCPv4, mais aussi le support des annonces de routeurs ainsi
qu'une fonctionnalité permettant l'addition de ressources AAAA pour des
clients utilisant DHCPv4 et la configuration IPv6 sans état (stateless
autoconfiguration).
Il inclut le support d'allocations d'adresses (à la fois en DHCPv6 et en
annonces de routeurs - RA) pour des sous-réseaux dynamiquement délégués via
une délégation de préfixe DHCPv6.
.PP
Dnsmasq est développé pour de petits systèmes embarqués. Il tend à avoir
l'empreinte mémoire la plus faible possible pour les fonctions supportées,
et permet d'exclure les fonctions inutiles du binaire compilé.
.SH OPTIONS
Notes : Il est possible d'utiliser des options sans leur donner de paramètre.
Dans ce cas, la fonction correspondante sera désactivée. Par exemple
.B --pid-file=
(sans paramètre après le =) désactive l'écriture du fichier PID.
Sur BSD, à moins que le logiciel ne soit compilé avec la bibliothèque GNU
getopt, la forme longue des options ne fonctionne pas en ligne de commande; elle
est toujours supportée dans le fichier de configuration.
.TP
.B --test
Vérifie la syntaxe du ou des fichiers de configuration. Se termine avec le
code de retour 0 si tout est OK, ou un code différent de 0 dans le cas
contraire. Ne démarre pas Dnsmasq.
.TP
.B \-w, --help
Affiche toutes les options de ligne de commande.
.B --help dhcp
affiche les options de configuration connues pour DHCPv4, et
.B --help dhcp6
affiche les options de configuration connues pour DHCPv6.
.TP
.B \-h, --no-hosts
Ne pas charger les noms d'hôtes du fichier /etc/hosts.
.TP
.B \-H, --addn-hosts=<fichier>
Fichiers d'hôtes additionnels. Lire le fichier spécifié en plus de /etc/hosts.
Si
.B -h
est spécifié, lire uniquement le fichier spécifié. Cette option peut être
répétée afin d'ajouter d'autres fichiers. Si un répertoire est donné, lis les
fichiers contenus dans ce répertoire.
.TP
.B \-E, --expand-hosts
Ajoute le nom de domaine aux noms simples (ne contenant pas de point dans le
nom) contenus dans le fichier /etc/hosts, de la même façon que pour le service
DHCP. Notez que cela ne s'applique pas aux noms de domaine dans les CNAME, les
enregistrements PTR, TXT, etc...
.TP
.B \-T, --local-ttl=<durée>
Lorsque Dnsmasq répond avec une information provenant du fichier /etc/hosts ou
avec un bail DHCP, il donne un temps de vie (time-to-live) positionné à zéro,
afin d'indiquer à la machine faisant la requête que celle-ci ne doit pas être
mise dans un cache. Ceci est le comportement correct dans presque toutes les
situations.
Cette option permet de spécifier la valeur de time-to-live à retourner (en
secondes). Cela permet de réduire la charge sur le serveur, mais les clients
risquent d'utiliser des données périmées dans certains cas.
.TP
.B --neg-ttl=<durée>
Les réponses négatives provenant des serveurs amonts contiennent normalement
une information de durée de vie (time-to-live) dans les enregistrements SOA,
information dont dnsmasq se sert pour mettre la réponse en cache. Si la réponse
du serveur amont omet cette information, dnsmasq ne cache pas la réponse. Cette
option permet de donner une valeur de durée de vie par défaut (en secondes) que
dnsmasq utilise pour mettre les réponses négatives dans son cache, même en
l'absence d'enregistrement SOA.
.TP
.B --max-ttl=<durée>
Définie la valeur de TTL maximum qui sera fournie aux clients. La valeur maximum
de TTL spécifiée sera fournie aux clients en remplacement de la vraie valeur de
TTL si cette dernière est supérieure. La valeur réelle de TTL est cependant
conservée dans le cache afin d'éviter de saturer les serveurs DNS en amont.
.TP
.B --max-cache-ttl=<durée>
Définie la valeur de TTL maximum pour les entrées dans le cache
.TP
.B --auth-ttl=<durée>
Définie la valeur de TTL retournée pour les réponses du serveur faisant
autorité.
.TP
.B \-k, --keep-in-foreground
Ne pas aller en tâche de fond au lancement, mais en dehors de cela, fonctionner
normalement. Ce mode est prévu pour les cas où Dnsmasq est lancé par daemontools
ou launchd.
.TP
.B \-d, --no-daemon
Mode debug (déverminage) : ne pas aller en tâche de fond, ne pas écrire de
fichier pid, ne pas changer d'identifiant utilisateur, générer un état complet
du cache lors de la réception d'un signal SIGUSR1, envoyer les logs sur la
sortie standard d'erreur ("stderr") de même que dans le syslog, ne pas créer de
processus fils pour traiter les requêtes TCP. A noter que cette option est à
user pour du déverminage seulement : pour empêcher dnsmasq se fonctionner en
mode démon en production, utiliser
.B -k.
.TP
.B \-q, --log-queries
Enregistrer les résultats des requêtes DNS traitées par Dnsmasq dans un fichier
de traces ("logs"). Active la génération d'un état complet du cache lors de la
réception d'un signal SIGUSR1.
.TP
.B \-8, --log-facility=<facility>
Définit la "facility" dans laquelle Dnsmasq enverra ses entrées syslog, par
défaut DAEMON ou LOCAL0 si le mode debug est activé. Si la "facility" contient
au moins un caractère "/", alors Dnsmasq considère qu'il s'agit d'un fichier et
enverra les logs dans le fichier correspondant à la place du syslog. Si la
"facility" est '-', alors dnsmasq envoie les logs sur la sortie d'erreur
standard stderr. (Les erreurs lors de la lecture de la configuration vont
toujours vers le syslog, mais tous les messages postérieurs à un démarrage
réussi seront exclusivement envoyés vers le fichier de logs).
Lorsque Dnsmasq est configuré pour envoyer
ses traces vers un fichier, la réception d'un signal SIGUSR2 entraine la
fermeture et réouverture du fichier. Cela permet la rotation de fichiers de
traces sans nécessiter l'arrêt de Dnsmasq.
.TP
.B --log-async[=<lignes>]
Permet l'envoi de traces de manière asynchrone, et de manière optionnelle, le
nombre de lignes devant être mises dans la file d'attente par Dnsmasq lorsque
l'écriture vers le syslog est lente.
Dnsmasq peut envoyer ses logs de manière asynchrone : cela lui permet de
continuer à fonctionner sans être bloqué par le syslog, et permet à syslog
d'utiliser Dnsmasq pour les résolutions DNS sans risque d'interblocage.
Si la file d'attente devient pleine, Dnsmasq loggera le dépassement de file et
le nombre de messages perdus. La longueur par défaut de la file d'attente est de
5 et une valeur saine sera comprise entre 5 et 25, avec une limite maximum
imposée de 100.
.TP
.B \-x, --pid-file=<chemin>
Spécifie un fichier dans lequel stocker le numéro de processus (pid). La valeur
par défaut est /var/run/dnsmasq.pid.
.TP
.B \-u, --user=<nom d'utilisateur>
Spécifie l'identité (nom d'utilisateur) prise par Dnsmasq après le démarrage.
Dnsmasq doit normalement être démarré en temps que root ("super-utilisateur"),
mais abandonne ses privilèges après le démarrage en changeant d'identité.
Normalement cet utilisateur est l'utilisateur nobody ("personne"), mais il est
possible d'en définir un autre par le biais de ce paramètre.
.TP
.B \-g, --group=<nom de groupe>
Spécifie le groupe sous lequel Dnsmasq s'exécute. Par défaut, il s'agit du
groupe "dip", afin de faciliter l'accès au fichier /etc/ppp/resolv.conf qui
n'est en général pas en lecture par tout le monde.
.TP
.B \-v, --version
Imprime le numéro de version.
.TP
.B \-p, --port=<port>
Ecoute sur le port numéro <port> au lieu du port DNS standard (53). Paramétrer
cette valeur à zéro désactive complètement la fonction DNS pour ne laisser actif
que le DHCP ou le TFTP.
.TP
.B \-P, --edns-packet-max=<taille>
Spécifie la taille maximum de paquet UDP EDNS.0 supporté par le relai DNS. Le
défaut est de 4096, qui est la valeur recommandée dans la RFC5625.
.TP
.B \-Q, --query-port=<numéro de port>
Envoie et écoute les requêtes DNS sortantes depuis le port UDP spécifié par
<numéro de port>, et non sur un port aléatoire. NOTE : Cette option rends
dnsmasq moins sûr contre les attaques par usurpation DNS ("DNS spoofing"), mais
cela peut permettre d'utiliser moins de ressources et d'être plus rapide. Donner
une valeur de zéro à cette option restaure le comportement par défaut présent dans
les versions de dnsmasq inférieures à 2.43 qui consiste à n'allouer qu'un seul port
alloué par le système d'exploitation.
.TP
.B --min-port=<port>
Ne pas utiliser de port dont le numéro est inférieur à la valeur donnée en paramètre
pour les requêtes DNS sortantes. Dnsmasq choisis un port source aléatoire pour les
requêtes sortantes : lorsque cette option est fournie, les ports utilisés seront toujours
au dessus de la valeur spécifiée. Utile pour des systèmes derrière des dispositifs
garde-barrières ("firewalls").
.TP
.B \-i, --interface=<nom d'interface>
N'écouter que sur l'interface réseau spécifiée. Dnsmasq ajoute automatiquement
l'interface locale ("loopback") à la liste des interfaces lorsque l'option
.B --interface
est utilisée.
Si aucune option
.B --interface
ou
.B --listen-address
n'est donnée, Dnsmasq écoutera sur toutes les interfaces disponibles sauf
celle(s) spécifiée(s) par l'option
.B --except-interface.
Les alias d'interfaces IP (par exemple "eth1:0") ne peuvent être utilisés ni avec
.B --interface
ni
.B \--except-interface.
Utiliser l'option
.B --listen-address
à la place. Un simple joker, consistant en un '*' final, peut être utilisé dans
les options
.B \--interface
et
.B \--except-interface
.TP
.B \-I, --except-interface=<interface name>
Ne pas écouter sur l'interface spécifiée. Notez que l'ordre dans lesquelles les
options
.B \--listen-address
,
.B --interface
et
.B --except-interface
sont fournies n'importe pas, et que l'option
.B --except-interface
l'emporte toujours sur les autres.
.TP
.B --auth-server=<domaine>,<interface>|<adresse IP>
Active le mode DNS faisant autorité pour les requêtes arrivant sur cette
interface ou sur cette adresse. Noter que l'interface ou l'adresse n'ont
pas besoin d'être mentionnées ni dans
.B --interface
ni dans
.B --listen-address
En effet,
.B --auth-server
va passer outre ceux-ci et fournir un service DNS différent sur l'interface
spécifiée. La valeur de <domaine> est l'enregistrement de type "colle"
("glue record"). Il doit correspondre dans le service DNS global avec un
enregistrement de type A et/ou AAAA pointant sur l'adresse sur laquelle dnsmasq
écoute pour le mode DNS faisant autorité.
.TP
.B \-2, --no-dhcp-interface=<nom d'interface>
Ne pas fournir de service DHCP sur l'interface spécifiée, mais fournir tout de
même le service DNS.
.TP
.B \-a, --listen-address=<adresse IP>
Ecouter sur la ou les adresse(s) IP spécifiée(s). Les options
.B \--interface
et
.B \--listen-address
peuvent être spécifiées simultanément, auquel cas un jeu d'interfaces et
d'adresses seront utilisées. Notez que si
aucune option
.B \--interface
n'est donnée alors qu'une option
.B \--listen-address
l'est, Dnsmasq n'écoutera pas automatiquement sur l'interface locale
("loopback"). Pour activer l'écoute sur l'interface locale, il est alors
nécessaire de fournir explicitement son adresse IP, 127.0.0.1 via l'option
.B \--listen-address.
.TP
.B \-z, --bind-interfaces
Sur les systèmes qui le supportent, Dnsmasq s'associe avec l'interface joker
("wildcard"), même lorsqu'il ne doit écouter que sur certaines interfaces. Par
la suite, il rejette les requêtes auxquelles il ne doit pas répondre. Cette
situation présente l'avantage de fonctionner même lorsque les interfaces vont
et viennent ou changent d'adresses. L'option
.B --bind-interfaces
force Dnsmasq à ne réellement s'associer qu'avec les interfaces sur lesquelles
il doit écouter. L'un des seuls cas où cette option est utile est celui où un
autre serveur de nom (ou une autre instance de Dnsmasq) tourne sur la même
machine. Utiliser cette option permet également d'avoir plusieurs instances de
Dnsmasq fournissant un service DHCP sur la même machine.
.TP
.B --bind-dynamic
Autorise un mode réseau intermédiaire entre
.B --bind-interfaces
et le mode par défaut. Dnsmasq s'associe à une seule interface, ce qui permet
plusieurs instances de dnsmasq, mais si une interface ou adresse apparaissent,
il se mettra automatiquement à écouter sur celles-ci (les règles de contrôle
d'accès s'appliquent).
De fait, les interfaces créées dynamiquement fonctionnent de la même façon que
dans le comportement par défaut. Ce fonctionnement nécessite des APIs réseau
non standard et n'est disponible que sous Linux. Sur les autres plateformes,
le fonctionnement est celui du mode --bind-interfaces.
.TP
.B \-y, --localise-queries
Retourne des réponses aux requêtes DNS dépendantes de l'interface sur laquelle
la requête a été reçue, à partir du fichier /etc/hosts. Si un nom dans
/etc/hosts a plus d'une adresse associée avec lui, et qu'une des adresses au
moins est dans le même sous-réseau que l'interface sur laquelle la requête a été
reçue, alors ne retourne que la(les) adresse(s) du sous-réseau considéré. Cela
permet d'avoir dans /etc/hosts un serveur avec de multiples adresses, une pour
chacune de ses interfaces, et de fournir aux hôtes l'adresse correcte (basée sur
le réseau auquel ils sont attachés). Cette possibilité est actuellement limitée
à IPv4.
.TP
.B \-b, --bogus-priv
Fausse résolution inverse pour les réseaux privés. Toutes les requêtes DNS
inverses pour des adresses IP privées (192.168.x.x, etc...) qui ne sont pas
trouvées dans /etc/hosts ou dans le fichier de baux DHCP se voient retournées
une réponse "pas de tel domaine" ("no such domain") au lieu d'être transmises
aux serveurs de nom amont ("upstream server").
.TP
.B \-V, --alias=[<ancienne IP>]|[<IP de début>-<IP de fin>],<nouvelle IP>[,<masque>]
Modifie les adresses IPv4 retournées par les serveurs de nom amont;
<ancienne IP> est remplacée par <nouvelle IP>. Si le <masque> optionnel est
fourni, alors toute adresse correspondant à l'adresse <ancienne IP>/<masque>
sera réécrite. Ainsi par exemple
.B --alias=1.2.3.0,6.7.8.0,255.255.255.0
modifiera 1.2.3.56 en 6.7.8.56 et 1.2.3.67 en 6.7.8.67.
Cette fonctionnalité correspond à ce que les routeurs Cisco PIX appellent
"bidouillage DNS" ("DNS doctoring"). Si l'ancienne IP est donnée sous la forme
d'une gamme d'adresses, alors seules les adresses dans cette gamme seront
réécrites, et non le sous-réseau dans son ensemble. Ainsi,
.B --alias=192.168.0.10-192.168.0.40,10.0.0.0,255.255.255.0
fait correspondre 192.168.0.10->192.168.0.40 à 10.0.0.10->10.0.0.40
.TP
.B \-B, --bogus-nxdomain=<adresse IP>
Transforme les réponses contenant l'adresse IP fournie en réponses "pas de tel
domaine" ("no such domain"). Ceci a pour but de neutraliser la modification
sournoise mise en place par Verisign en septembre 2003, lorsqu'ils ont commencé
à retourner l'adresse d'un serveur web publicitaire en réponse aux requêtes pour
les noms de domaines non enregistrés, au lieu de la réponse correcte "NXDOMAIN".
Cette option demande à Dnsmasq de retourner la réponse correcte lorsqu'il
constate ce comportement. L'adresse retournée par Verisign en septembre 2003
est 64.94.110.11.
.TP
.B \-f, --filterwin2k
Les dernières versions de windows font des requêtes DNS périodiques auxquelles
non seulement les serveurs DNS publics ne peuvent donner de réponse, mais qui,
de surcroît, peuvent poser des problèmes en déclenchant des connexions
intempestives pour des liens réseaux avec des connexions "à la demande". Fournir
cette option active le filtrage des requêtes de ce type. Les requêtes bloquées
sont les requêtes pour les entrées de type SOA ou SRV, ainsi que les requêtes de
type ANY avec des noms possédant des caractères sous-lignés (requêtes pour des
serveurs LDAP).
.TP
.B \-r, --resolv-file=<fichier>
Lis les adresses des serveurs de nom amont dans le fichier de nom <fichier>,
au lieu du fichier /etc/resolv.conf. Pour le format de ce fichier, voir dans le
manuel pour
.BR resolv.conf (5)
les entrées correspondant aux serveurs de noms (nameserver). Dnsmasq peut lire
plusieurs fichiers de type resolv.conf, le premier fichier spécifié remplace le
fichier par défaut, le contenu des suivants est rajouté dans la liste des
fichiers à consulter. Seul le fichier ayant la dernière date de modification
sera chargé en mémoire.
.TP
.B \-R, --no-resolv
Ne pas lire le contenu du fichier /etc/resolv.conf. N'obtenir l'adresse des
serveurs de nom amont que depuis la ligne de commande ou le fichier de
configuration de Dnsmasq.
.TP
.B \-1, --enable-dbus[=<nom de service>]
Autoriser la mise à jour de la configuration de Dnsmasq par le biais d'appel de
méthodes DBus. Il est possible par ce biais de mettre à jour l'adresse de
serveurs DNS amont (et les domaines correspondants) et de vider le cache. Cette
option nécessite que Dnsmasq soit compilé avec le support DBus. Si un nom de
service est fourni, dnsmasq fourni un service à ce nom, plutôt qu'avec la
valeur par défaut :
.B uk.org.thekelleys.dnsmasq
.TP
.B \-o, --strict-order
Par défaut, Dnsmasq envoie les requêtes à n'importe lequel des serveurs amonts
dont il a connaissance tout en essayant de favoriser les serveurs qu'il sait
fonctionner. Cette option force Dnsmasq à essayer d'interroger, pour chaque
requête, les serveurs DNS dans leur ordre d'apparition dans le fichier
/etc/resolv.conf.
.TP
.B --all-servers
Par défaut, lorsque dnsmasq a plus d'un serveur amont disponible, il n'envoie
les requêtes qu'à un seul serveur. Spécifier cette option force dnsmasq à
effectuer ses requêtes à tous les serveurs disponibles. Le résultat renvoyé
au client sera celui fournit par le premier serveur ayant répondu.
.TP
.B --stop-dns-rebind
Rejette (et enregistre dans le journal d'activité) les adresses dans la gamme
d'adresses IP privée (au sens RFC1918) qui pourraient être renvoyées par les
serveurs amonts suite à une résolution de nom. Cela bloque les attaques cherchant
à détourner de leur usage les logiciels de navigation web ('browser') en s'en
servant pour découvrir les machines situées sur le réseau local.
.TP
.B --rebind-localhost-ok
Exclue 127.0.0/8 des vérifications de réassociation DNS. Cette gamme d'adresses
est retournée par les serveurs Realtime Blackhole (RBL, utilisés dans la
lutte contre le spam), la bloquer peut entraîner des dysfonctionnements de ces
services.
.TP
.B --rebind-domain-ok=[<domaine>]|[[/<domaine>/[<domaine>/]
Ne pas détecter ni bloquer les actions de type dns-rebind pour ces domaines.
Cette option peut prendre comme valeur soit un nom de domaine soit plusieurs
noms de domaine entourés par des '/', selon une syntaxe similaire à l'option
--server, c-à-d :
.B --rebind-domain-ok=/domaine1/domaine2/domaine3/
.TP
.B \-n, --no-poll
Ne pas vérifier régulièrement si le fichier /etc/resolv.conf a été modifié.
.TP
.B --clear-on-reload
Lorsque le fichier /etc/resolv.conf est relu, ou si les serveurs amonts sont
configurés via DBus, vider le cache DNS.
Cela est utile si les nouveaux serveurs sont susceptibles d'avoir des données
différentes de celles stockées dans le cache.
.TP
.B \-D, --domain-needed
Indique à Dnsmasq de ne jamais transmettre en amont de requêtes A ou AAAA pour
des noms simples, c'est à dire ne comprenant ni points ni nom de domaine. Si un
nom n'est pas dans /etc/hosts ou dans la liste des baux DHCP, alors une réponse
de type "non trouvé" est renvoyée.
.TP
.B \-S, --local, --server=[/[<domaine>]/[domaine/]][<Adresse IP>[#<port>][@<Adresse IP source>|<interface>[#<port>]]]
Spécifie directement l'adresse IP d'un serveur de nom amont. Cette option ne
supprime pas la lecture du fichier /etc/resolv.conf : utiliser pour cela
l'option
.B -R .
Si un ou plusieurs nom(s) de domaine(s) optionnel(s) sont fournis, ce
serveur sera uniquement utilisé uniquement pour ce(s) domaine(s), et toute
requête concernant ce(s) domaine(s) sera adressée uniquement à ce serveur.
Cette option est destinée aux serveurs de nom privés : si vous avez un serveur
de nom sur votre réseau ayant pour adresse IP 192.168.1.1 et effectuant la
résolution des noms de la forme xxx.internal.thekelleys.org.uk, alors
.B -S /internal.thekelleys.org.uk/192.168.1.1
enverra toutes les requêtes pour les machines internes vers ce serveur de nom,
alors que toutes les autres requêtes seront adressées aux serveurs indiqués dans
le fichier /etc/resolv.conf. Une spécification de nom de domaine vide,
.B //
possède le sens particulier de "pour les noms non qualifiés uniquement",
c'est-à-dire les noms ne possédant pas de points. Un port non standard peut être
rajouté à la suite des adresses IP en utilisant le caractère #. Plus d'une
option
.B -S
est autorisée, en répétant les domaines et adresses IP comme requis.
Le domaine le plus spécifique l'emporte sur le domaine le moins spécifique,
ainsi :
.B --server=/google.com/1.2.3.4
.B --server=/www.google.com/2.3.4.5
enverra les requêtes pour *.google.com à 1.2.3.4, à l'exception des requêtes
*www.google.com, qui seront envoyées à 2.3.4.5.
L'adresse spéciale '#' signifie "utiliser les serveurs standards", ainsi
.B --server=/google.com/1.2.3.4
.B --server=/www.google.com/#
enverra les requêtes pour *.google.com à 1.2.3.4, à l'exception des requêtes
pour *www.google.com qui seront envoyées comme d'habitude (c-à-d aux serveurs
définis par défaut).
Il est également permis de donner une option
.B -S
avec un nom de domaine mais sans
adresse IP; Cela informe Dnsmasq que le domaine est local et qu'il doit répondre
aux requêtes le concernant depuis les entrées contenues dans le fichier
/etc/hosts ou les baux DHCP, et ne doit en aucun cas transmettre les requêtes
aux serveurs amonts.
.B local
est synonyme de
.B server
("serveur") afin de rendre plus claire l'utilisation de cette option pour cet
usage particulier.
Les adresses IPv6 peuvent inclure un identifiant de zone sous la forme
%interface tel que par exemple
fe80::202:a412:4512:7bbf%eth0.
La chaîne de caractères optionnelle suivant le caractère @ permet de définir
la source que Dnsmasq doit utiliser pour les réponses à ce
serveur de nom. Il doit s'agir d'une des adresses IP appartenant à la machine sur
laquelle tourne Dnsmasq ou sinon la ligne sera ignorée et une erreur sera
consignée dans le journal des événements, ou alors d'un nom d'interface. Si un nom
d'interface est donné, alors les requêtes vers le serveur de nom seront envoyées
depuis cette interface; si une adresse IP est donnée, alors l'adresse source de
la requête sera l'adresse en question. L'option query-port est ignorée pour tous
les serveurs ayant une adresse source spécifiée, mais il est possible de la donner
directement dans la spécification de l'adresse source. Forcer les requêtes à être
émises depuis une interface spécifique n'est pas possible sur toutes les plateformes
supportées par dnsmasq.
.TP
.B \-A, --address=/<domaine>/[domaine/]<adresse IP>
Spécifie une adresse IP à retourner pour toute requête pour les domaines fournis
en option. Les requêtes pour ce(s) domaine(s) ne sont jamais transmises aux
serveurs amonts et reçoivent comme réponse l'adresse IP spécifiée qui peut être
une adresse IPv4 ou IPv6. Pour donner à la fois une adresse IPv4 et une adresse
IPv6 pour un domaine, utiliser plusieurs options
.B -A.
Il faut noter que le
contenu du fichier /etc/hosts et de celui des baux DHCP supplante ceci pour des
noms individuels. Une utilisation courante de cette option est de rediriger la
totalité du domaine doubleclick.net vers un serveur web local afin d'éviter les
bannières publicitaires. La spécification de domaine fonctionne de la même façon
que
.B --server,
avec la caractéristique supplémentaire que
.B /#/
coïncide avec tout domaine. Ainsi,
.B --address=/#/1.2.3.4
retournera 1.2.3.4 pour toute requête
n'ayant de réponse ni dans /etc/hosts, ni dans les baux DHCP, et n'étant pas
transmise à un serveur spécifique par le biais d'une directive
.B --server.
.TP
.B --ipset=/<domaine>/[domaine/]<ipset>[,<ipset>]
Obtient les adresses IP des domaines spécifiés et les place dans les groupes
d'IP netfilter (ipset) indiqués. Domaines et sous-domaines sont résolus de la
même façon que pour --address. Ces groupes d'IP doivent déjà exister. Voir
ipset(8) pour plus de détails.
.TP
.B \-m, --mx-host=<nom de l'hôte>[[,<nom du MX>],<préférence>]
Spécifie un enregistrement de type MX pour <nom de l'hôte> retournant le nom
donné dans <nom du MX> (s'il est présent), ou sinon le nom spécifié dans
l'option
.B --mx-target
si elle est présente. Sinon retourne le nom de la machine
sur laquelle Dnsmasq tourne. La valeur par défaut (spécifiée dans l'option
.B --mx-target
) est utile dans un réseau local pour rediriger les courriers
électroniques vers un serveur central. La valeur de préférence est optionnelle
et vaut par défaut 1 si elle n'est pas spécifiée. Plus d'une entrée MX peut être
fournie pour un hôte donné.
.TP
.B \-t, --mx-target=<nom d'hôte>
Spécifie la réponse par défaut fournie par Dnsmasq pour les requêtes sur des
enregistrements de type MX. Voir
.B --mx-host.
Si
.B --mx-target
est donné mais pas de
.B --mx-host,
alors Dnsmasq retourne comme réponse un enregistrement MX
contenant le nom d'hôte spécifié dans l'option
.B --mx-target
pour toute requête
concernant le MX de la machine sur laquelle tourne Dnsmasq.
.TP
.B \-e, --selfmx
Définit, pour toutes les machines locales, un MX correspondant à l'hôte
considéré. Les machines locales sont celles définies dans le fichier /etc/hosts
ou dans un bail DHCP.
.TP
.B \-L, --localmx
Définit, pour toutes les machines locales, un enregistrement MX pointant sur
l'hôte spécifié par mx-target (ou la machine sur laquelle Dnsmasq tourne). Les
machines locales sont celles définies dans le fichier /etc/hosts ou dans un bail
DHCP.
.TP
.B \-W --srv-host=<_service>.<_protocole>.[<domaine>],[<cible>[,<port>[,<priorité>[,<poids>]]]]
Spécifie un enregistrement DNS de type SRV. Voir la RFC2782 pour plus de
détails. Si le champs <domaine> n'est pas fourni, prends par défaut la valeur
fournie dans l'option
.B --domain.
La valeur par défaut pour le domaine est vide et le port par défaut est 1, alors
que les poids et priorités par défaut sont 0. Attention lorsque vous transposez
des valeurs issues d'une configuration BIND : les ports, poids et priorités sont
dans un ordre différents. Pour un service/domaine donné, plus d'un
enregistrement SRV est autorisé et tous les enregistrements qui coïncident sont
retournés dans la réponse.
.TP
.B --host-record=<nom>[,<nom>....][<adresse IPv4>],[<adresse IPv6>]
Ajoute des enregistrements A, AAAA et PTR dans le DNS. Ceci permet d'ajouter
un ou plusieurs noms dans le DNS et de les associer à des enregistrements IPv4
(A) ou IPv6 (AAAA). Un nom peut apparaître dans plus d'une entrée
.B host-record
et de fait être associé à plus d'une adresse. Seule la première entrée créée
l'enregistrement PTR associée au nom. Ceci correspond à la même règle que celle
utilisée lors de la lecture du fichier hosts.
Les options
.B host-record
sont considérées lues avant le fichier hosts, ainsi un nom apparaissant dans
une option host-record et dans le fichier hosts n'aura pas d'enregistrement
PTR associé à l'entrée dans le fichier hosts. A l'inverse du fichier hosts, les
noms ne sont pas étendus, même lorsque l'option
.B expand-hosts
est activée. Les noms longs et les noms courts peuvent apparaitre dans la même
entrée
.B host-record,
c-à-d
.B --host-record=laptop,laptop.thekelleys.org,192.168.0.1,1234::100
.TP
.B \-Y, --txt-record=<nom>[[,<texte>],<texte>]
Définit un enregistrement DNS de type TXT. La valeur de l'enregistrement TXT est
un ensemble de chaînes de caractères, donc un nombre variable de chaînes de
caractères peuvent être spécifiées, séparées par des virgules. Utilisez des
guillemets pour mettre une virgule dans une chaîne de caractères. Notez que la
longueur maximale pour une chaîne est de 255 caractères, les chaînes plus
longues étant découpées en morceaux de 255 caractères de longs.
.TP
.B --ptr-record=<nom>[,<cible>]
Définit un enregistrement DNS de type PTR.
.TP
.B --naptr-record=<nom>,<ordre>,<préférence>,<drapeaux>,<service>,<expr. régulière>[,<remplacement>]
Retourne un enregistrement de type NAPTR, tel que spécifié dans le RFC3403.
.TP
.B --cname=<cname>,<cible>
Retourne un enregistrement de type CNAME qui indique que <cname> est en
réalité <cible>. Il existe des contraintes importantes sur la valeur
cible; il doit s'agir d'un nom DNS qui est connu de dnsmasq via /etc/hosts
(ou un fichier hôtes additionnel), via DHCP, via interface--name ou par un autre
.B --cname.
Si une cible ne satisfait pas ces critères, le CNAME est ignoré. Le CNAME
doit être unique, mais il est autorisé d'avoir plus d'un CNAME pointant
vers la même cible.
.TP
.B --dns-rr=<nom>,<numéro-RR>,[<données hexadécimales>]
Retourne un enregistrement DNS arbitraire. Le numéro correspond au type
d'enregistrement (qui est toujours de la classe C_IN). La valeur de
l'enregistrement est donnée dans les données hexadécimales, qui peuvent
être de la forme 01:23:45, 01 23 45,+012345 ou n'importe quelle combinaison.
.TP
.B --interface-name=<nom>,<interface>
Définit un enregistrement DNS associant le nom avec l'adresse primaire sur
l'interface donnée en argument. Cette option spécifie un enregistrement de type
A pour le nom donné en argument de la même façon que s'il était défini par une
ligne de /etc/hosts, sauf que l'adresse n'est pas constante mais dépendante de
l'interface définie. Si l'interface est inactive, non existante ou non
configurée, une réponse vide est fournie. Un enregistrement inverse (PTR) est
également créé par cette option, associant l'adresse de l'interface avec le nom.
Plus d'un nom peut être associé à une interface donnée en répétant cette option
plusieurs fois; dans ce cas, l'enregistrement inverse pointe vers le nom fourni
dans la première instance de cette option.
.TP
.B --synth-domain=<domaine>,<plage d'adresses>[,<préfixe>]
Créé des enregistrements A/AAAA ou PTR pour une plage d'adresses. Les
enregistrements utilisent l'adresse ainsi que les points (ou les deux points
dans le cas d'IPv6) remplacés par des tirets.
Un exemple devrait rendre cela plus clair :
La configuration
.B --synth-domain=thekelleys.org.uk,192.168.0.0/24,internal-
permet de retourner internal-192-168-0-56.thekelleys.org.uk lors d'une requête
sur l'adresse 192.168.0.56 et vice-versa pour la requête inverse. La même
logique s'applique pour IPv6, avec la particularité suivante : les adresses
IPv6 pouvant commencer par '::', mais les noms DNS ne pouvant pas commencer
par '-', si aucun préfixe n'est donné, un zéro est ajouté en début de nom.
Ainsi, ::1 devient 0--1.
La plage d'adresses peut être de la forme
<adresse IP>,<adresse IP> ou <adresse IP>/<masque réseau>
.TP
.B --add-mac
Ajoute l'adresse MAC du requêteur aux requêtes DNS transmises aux serveurs
amonts. Cela peut être utilisé dans un but de filtrage DNS par les serveurs
amonts. L'adresse MAC peut uniquement être ajoutée si le requêteur est sur le
même sous-réseau que le serveur dnsmasq. Veuillez noter que le mécanisme
utilisé pour effectuer cela (une option EDNS0) n'est pas encore standardisée,
aussi cette fonctionnalité doit être considérée comme expérimentale. Notez
également qu'exposer les adresses MAC de la sorte peut avoir des implications
en termes de sécurité et de vie privée. L'avertissement donné pour --add-subnet
s'applique également ici.
.TP
.B --add-subnet[[=<longueur de préfixe IPv4>],<longueur de préfixe IPv6>]
Rajoute l'adresse de sous-réseau du requêteur aux requêtes DNS transmises
aux serveurs amonts. La quantité d'adresses transmises dépend du paramètre
longueur du préfixe : 32 (ou 128 dans le cas d'IPv6) transmet la totalité
de l'adresse, 0 n'en transmet aucun mais marque néanmoins la requête ce qui
fait qu'aucun serveur amont ne rajoutera d'adresse client. La valeur par
défaut est zéro et pour IPv4 et pour IPv6. A noter que les serveurs amonts
peuvent être configurés pour retourner des valeurs différentes en fonction
de cette information mais que le cache de dnsmasq n'en tient pas compte.
Si une instance de dnsmasq est configurée de telle manière que des valeurs
différentes pourraient être rencontrées, alors le cache devrait être désactivé.
.TP
.B \-c, --cache-size=<taille>
Définit la taille du cache de Dnsmasq. La valeur par défaut est de 150 noms.
Définir une valeur de zéro désactive le cache. Remarque: la taille importante
du cache a un impact sur les performances.
.TP
.B \-N, --no-negcache
Désactive le "cache négatif". Le "cache négatif" permet à Dnsmasq de se souvenir
des réponses de type "no such domain" fournies par les serveurs DNS en amont et
de fournir les réponses sans avoir à retransmettre les requêtes aux serveurs
amont.
.TP
.B \-0, --dns-forward-max=<nombre de requêtes>
Définit le nombre maximum de requêtes DNS simultanées. La valeur par défaut est
150, ce qui devrait être suffisant dans la majorité des configurations. La seule
situation identifiée dans laquelle cette valeur nécessite d'être augmentée est
lorsqu'un serveur web a la résolution de nom activée pour l'enregistrement de
son journal des requêtes, ce qui peut générer un nombre important de requêtes
simultanées.
.TP
.B --proxy-dnssec
Un résolveur sur une machine cliente peut effectuer la validation DNSSEC de
deux façons : il peut effectuer lui-même les opérations de chiffrements sur
la réponse reçue, ou il peut laisser le serveur récursif amont faire la
validation et positionner un drapeau dans la réponse au cas où celle-ci est
correcte. Dnsmasq n'est pas un validateur DNSSEC, aussi il ne peut effectuer
la validation comme un serveur de nom récursif, cependant il peut retransmettre
les résultats de validation de ses serveurs amonts. Cette option permet
l'activation de cette fonctionnalité. Vous ne devriez utiliser cela que si vous
faites confiance aux serveurs amonts
.I ainsi que le réseau entre vous et eux.
Si vous utilisez le premier mode DNSSEC, la validation par le résolveur des
clients, cette option n'est pas requise. Dnsmasq retourne toujours toutes les
données nécessaires par un client pour effectuer la validation lui-même.
.TP
.B --auth-zone=<domaine>[,<sous-réseau>[/<longueur de préfixe>][,<sous-réseau>[/<longueur de préfixe>].....]]
Définie une zone DNS pour laquelle dnsmasq agit en temps que serveur faisant
autorité. Les enregistrements DNS définis localement et correspondant à ce
domaine seront fournis. Les enregistrements A et AAAA doivent se situer dans
l'un des sous-réseaux définis, ou dans un réseau correspondant à une plage DHCP
(ce comportement peut être désactivé par
.B constructor-noauth:
). Le ou les sous-réseaux sont également utilisé(s) pour définir les domaines
in-addr.arpa et ip6.arpa servant à l'interrogation DNS inverse. Si la longueur
de préfixe n'est pas spécifiée, elle sera par défaut de 24 pour IPv4 et 64 pour
IPv6. Dans le cas d'IPv4, la longueur du masque de réseau devrait être de 8, 16
ou 24, sauf si en cas de mise en place d'une délégation de la zone in-addr.arpa
conforme au RFC 2317.
.TP
.B --auth-soa=<numéro de série>[,<mainteneur de zone (hostmaster)>[,<rafraichissement>[,<nombre de réessais>[,<expiration>]]]]
Spécifie les champs de l'enregistrement de type SOA (Start Of Authority)
associé à une zone pour laquelle le serveur fait autorité. A noter que cela est
optionnel, les valeurs par défaut devant convenir à la majorité des cas.
.TP
.B --auth-sec-servers=<domaine>[,<domaine>[,<domaine>...]]
Spécifie un ou plusieurs serveur de nom secondaires pour une zone pour
laquelle dnsmasq fait autorité. Ces serveurs doivent être configurés pour
récupérer auprès de dnsmasq les informations liées à la zone au travers d'un
transfert de zone, et répondre aux requêtes pour toutes les zones pour
lesquelles dnsmasq fait autorité.
.TP
.B --auth-peer=<adresse IP>[,<adresse IP>[,<adresse IP>...]]
Spécifie la ou les adresses de serveurs secondaires autorisés à initier des
requêtes de transfert de zone (AXFR) pour les zones pour lesquelles
dnsmasq fait autorité. Si cette option n'est pas fournie, les requêtes AXFR
seront acceptées pour tous les serveurs secondaires.
.TP
.B --conntrack
Lis le marquage de suivi de connexion Linux associé aux requêtes DNS entrantes
et positionne la même marque au trafic amont utilisé pour répondre à ces
requêtes. Cela permet au trafic généré par Dnsmasq d'être associé aux requêtes
l'ayant déclenché, ce qui est pratique pour la gestion de la bande passante
(accounting) et le filtrage (firewall). Dnsmasq doit pour cela être compilé
avec le support conntrack, le noyau doit également inclure conntrack et être
configuré pour cela. Cette option ne peut pas être combinée avec
--query-port.
.TP
.B \-F, --dhcp-range=[tag:<label>[,tag:<label>],][set:<label>],]<adresse de début>[,<adresse de fin>][,<mode>][,<masque de réseau>[,<broadcast>]][,<durée de bail>]
.TP
.B \-F, --dhcp-range=[tag:<label>[,tag:<label>],][set:<label>],]<adresse IPv6 de début>[,<adresse IPv6 de fin>|constructor:<interface>][,<mode>][,<longueur de préfixe>][,<durée de bail>]
Active le serveur DHCP. Les adresses seront données dans la plage comprise entre
<adresse de début> et <adresse de fin> et à partir des adresses définies
statiquement dans l'option
.B dhcp-host.
Si une durée de bail est donnée, alors les baux seront donnés pour cette
durée. La durée de bail est donnée en secondes, en minutes (exemple : 45m),
en heures (exemple : 1h) ou être la chaine de caractère "infinite" pour une
durée indéterminée. Si aucune valeur n'est donnée, une durée de bail par défaut
de une heure est appliquée. La valeur minimum pour un bail DHCP est de 2
minutes.
Pour les plages IPv6, la durée de bail peut être égale au mot-clef "deprecated"
(obsolète); Cela positionne la durée de vie préférée envoyée dans les baux DHCP
ou les annonces routeurs à zéro, ce qui incite les clients à utiliser d'autres
adresses autant que possible, pour toute nouvelle connexion, en préalable à
la renumérotation.
Cette option peut être répétée, avec différentes adresses,
pour activer le service DHCP sur plus d'un réseau. Pour des réseaux directement
connectés (c'est-à-dire des réseaux dans lesquels la machine sur laquelle tourne
Dnsmasq possède une interface), le masque de réseau est optionnel : Dnsmasq la
déterminera à partir de la configuration des interfaces.
Pour les réseaux pour lesquels le service DHCP se fait via un relais DHCP
("relay agent"), Dnsmasq est incapable de déterminer le masque par lui-même,
aussi il doit être spécifié, faute de quoi Dnsmasq essaiera de le deviner en
fonction de la classe (A, B ou C) de l'adresse réseau. L'adresse de broadcast
est toujours optionnelle.
Il est toujours possible d'avoir plus d'une plage DHCP pour un même
sous-réseau.
Pour IPv6, les paramètres sont légèrement différents : au lieu d'un masque de
réseau et d'une adresse de broadcast, il existe une longueur de préfixe
optionnelle. Si elle est omise, la valeur par défaut est 64. À la différence
d'IPv4, la longueur de préfixe n'est pas automatiquement déduite de la
configuration de l'interface. La taille minimale pour la longueur de préfixe
est 64.
Pour IPv6 (et IPv6 uniquement), il est possible de définir les plages d'une
autre façon. Dans ce cas, l'adresse de départ et l'adresse de fin optionnelle
contiennent uniquement la partie réseau (par exemple ::1) et sont suivies par
.B constructor:<interface>.
Cela forme un modèle décrivant comment construire la plage, à partir des
adresses assignées à l'interface. Par exemple
.B --dhcp-range=::1,::400,constructor:eth0
provoque la recherche d'adresses de la forme <réseau>::1 sur eth0 et crée une
plage allant de <réseau>::1 à <réseau>:400. Si une interface est assignée à
plus d'un réseau, les plages correspondantes seront automatiquement créées,
rendues obsolètes puis supprimées lorsque l'adresse est rendue obsolète puis
supprimée. Le nom de l'interface peut être spécifié avec un caractère joker '*'
final.
provoque la recherche d'adresses sur eth0 et crée une plage allant de
<réseau>::1 à <réseau>:400. Si l'interface est assignée à
plus d'un réseau, les plages correspondantes seront respectivement
automatiquement créées, rendues obsolètes et supprimées lorsque l'adresse
est rendue obsolète et supprimée. Le nom de l'interface peut être spécifié avec
un caractère joker '*' final. Les adresses autoconfigurées, privées ou
obsolètes ne conviennent pas.
Si une plage dhcp-range est uniquement utilisée pour du DHCP sans-état
("stateless") ou de l'autoconfiguration sans état ("SLAAC"), alors l'adresse
peut être indiquée sous la forme '::'
.B --dhcp-range=::,constructor:eth0
Il existe une variante de la syntaxe constructor: qui consiste en l'utilisation
du mot-clef
.B constructor-noauth.
Voir
.B --auth-zone
pour des explications à ce sujet.
L'identifiant de label optionnel
.B set:<label>
fournie une étiquette alphanumérique qui identifie ce réseau, afin de permettre
la fourniture d'options DHCP spécifiques à chaque réseau.
Lorsque préfixé par 'tag:', la signification change, et au lieu de définir un
label, il définit le label pour laquelle la règle s'applique. Un seul label peut-
être défini mais plusieurs labels peuvent coïncider.
Le mot clef optionnel <mode> peut être égal à
.B static
("statique") ce qui indique à Dnsmasq d'activer le service DHCP pour le réseau
spécifié, mais de ne pas activer l'allocation dynamique d'adresses IP : Seuls
les hôtes possédant des adresses IP statiques fournies via
.B dhcp-host
ou présentes dans le fichier /etc/ethers seront alors servis par le DHCP. Il est
possible d'activer un mode "fourre-tout" en définissant un réseau statique
comportant uniquement des zéros, c'est à dire :
.B --dhcp=range=::,static
Cela permet de retourner des réponses à tous les paquets de type
Information-request (requête d'information) en mode DHCPv6 sans état sur le
sous-réseau configuré.
Pour IPv4, le <mode> peut est égal à
.B proxy
, auquel cas Dnsmasq fournira un service de DHCP proxy pour le sous-réseau
spécifié. (voir
.B pxe-prompt
et
.B pxe-service
pour plus de détails).
Pour IPv6, le mode peut être une combinaison des valeurs
.B ra-only, slaac, ra-names, ra-stateless, off-link.
.B ra-only
indique à dnsmasq de n'effectuer que des annonces de routeur (Router
Advertisement, RA) sur ce sous-réseau, et de ne pas faire de DHCP.
.B slaac
indique à dnsmasq d'effectuer des annonces de routeur sur ce sous-réseau
et de positionner dans celles-ci le bit A, afin que les clients utilisent
des adresses SLAAC. Lorsqu'utilisé conjointement avec une plage DHCP ou des
affectations statiques d'adresses DHCP, les clients disposeront à la fois
d'adresses DHCP assignées et d'adresses SLAAC.
.B ra-stateless
indique à dnsmasq d'effectuer des annonces de routeur avec les bits 0 et A
positionnés, et de fournir un service DHCP sans état ("stateless"). Les clients
utiliseront des adresses SLAAC, et utiliseront DHCP pour toutes les autres
informations de configuration.
.B ra-names
active un mode qui fourni des noms DNS aux hôtes fonctionnant en double pile
("dual stack") et configurés pour faire du SLAAC en IPv6. Dnsmasq utilise le
bail IPv4 de l'hôte afin de dériver le nom, le segment de réseau et l'adresse
MAC et assume que l'hôte disposera d'une adresse IPv6 calculée via l'algorithme
SLAAC, sur le même segment de réseau. Un ping est envoyé à l'adresse, et si une
réponse est obtenue, un enregistrement AAAA est rajouté dans le DNS pour cette
adresse IPv6. Veuillez-noter que cela n'arrive que pour les réseaux directement
connectés (et non ceux pour lesquels DHCP se fait via relai), et ne
fonctionnera pas si un hôte utilise les "extensions de vie privée"
("privacy extensions").
.B ra-names
peut être combiné avec
.B ra-stateless
et
.B slaac.
.B off-link
indique à dnsmasq d'annoncer le préfixe sans le bit L (sur lien).
.TP
.B \-G, --dhcp-host=[<adresse matérielle>][,id:<identifiant client>|*][,set:<label>][,<adresse IP>][,<nom d'hôte>][,<durée de bail>][,ignore]
Spécifie les paramètres DHCP relatifs à un hôte. Cela permet à une machine
possédant une adresse matérielle spécifique de se voir toujours allouée les
mêmes nom d'hôte, adresse IP et durée de bail. Un nom d'hôte spécifié comme
ceci remplace le nom fourni par le client DHCP de la machine hôte. Il est
également possible d'omettre l'adresse matérielle et d'inclure le nom d'hôte,
auquel cas l'adresse IP et la durée de bail s'appliqueront à toute machine se
réclamant de ce nom. Par exemple
.B --dhcp-host=00:20:e0:3b:13:af,wap,infinite
spécifie à Dnsmasq de fournir à la machine d'adresse matérielle
00:20:e0:3b:13:af le nom, et un bail de durée indéterminée.
.B --dhcp-host=lap,192.168.0.199
spécifie à Dnsmasq d'allouer toujours à la machine portant le nom lap
l'adresse IP 192.168.0.199.
Les adresses allouées de la sorte ne sont pas contraintes à une plage d'adresse
spécifiée par une option --dhcp-range, mais elles se trouver dans le même
sous-réseau qu'une plage dhcp-range valide. Pour les sous-réseaux qui n'ont pas
besoin d'adresses dynamiquement allouées, utiliser le mot-clef "static" dans la
déclaration de plage d'adresses dhcp-range.
Il est possible d'utiliser des identifiants clients (appelés "DUID client" dans
le monde IPv6) plutôt que des adresses matérielles pour identifier les hôtes,
en préfixant ceux-ci par 'id:'. Ainsi,
.B --dhcp-host=id:01:02:03:04,.....
réfère à l'hôte d'identifiant 01:02:03:04. Il est également possible de
spécifier l'identifiant client sous la forme d'une chaîne de caractères, comme
ceci :
.B --dhcp-host=id:identifiantclientsousformedechaine,.....
Un seul
.B dhcp-host
peut contenir une adresse IPv4, une adresse IPv6, ou les deux en même temps.
Les adresses IPv6 doivent être mises entre crochets comme suit :
.B --dhcp-host=laptop,[1234::56]
Les adresses IPv6 peuvent ne contenir que la partie identifiant de client :
.B --dhcp-host=laptop,[::56]
Dans ce cas, lorsque des plages dhcp sont définies automatiquement par le biais
de constructeurs, la partie réseau correspondante est rajoutée à l'adresse.
A noter que pour le DHCP IPv6, l'adresse matérielle n'est pas toujours
disponible, bien que ce soit toujours le cas pour des clients directement
connectés (sur le même domaine de broadcast) ou pour des clients utilisant
des relais DHCP qui supportent la RFC 6939.
En DHCPv4, l'option spéciale id:* signifie : "ignorer tout identifiant client et n'utiliser
que l'adresse matérielle". Cela est utile lorsqu'un client présente un
identifiant client mais pas les autres.
Si un nom apparaît dans /etc/hosts, l'adresse associée peut être allouée à un
bail DHCP mais seulement si une option
.B --dhcp-host
spécifiant le nom existe par ailleurs. Seul un nom d'hôte peut être donné dans
une option
.B dhcp-host
, mais les alias sont possibles au travers de l'utilisation des CNAMEs. (Voir
.B --cname
).
Le mot clef "ignore" ("ignorer") indique
à Dnsmasq de ne jamais fournir de bail DHCP à une machine. La machine peut être
spécifiée par son adresse matérielle, son identifiant client ou son nom d'hôte.
Par exemple
.B --dhcp-host=00:20:e0:3b:13:af,ignore
Cela est utile lorsqu'un autre serveur DHCP sur le réseau doit être utilisé par
certaines machines.
Le paramètre set:<identifiant réseau> permet de définir un
identifiant de réseau lorsque l'option dhcp-host est utilisée. Cela peut servir
à sélectionner des options DHCP juste pour cet hôte. Plus d'un label peut être
fourni dans une directive dhcp-host (et dans cette seule directive). Lorsqu'une
machine coïncide avec une directive dhcp-host (ou une impliquée par
/etc/ethers), alors le label réservé "known" ("connu") est associé. Cela permet à
Dnsmasq d'être configuré pour ignorer les requêtes issus de machines inconnue
par le biais de
.B --dhcp-ignore=tag:!known.
Les adresses ethernet (mais pas les identifiants clients) peuvent être définies
avec des octets joker, ainsi par exemple
.B --dhcp-host=00:20:e0:3b:13:*,ignore
demande à Dnsmasq d'ignorer une gamme d'adresses matérielles. Il est à noter
que "*" doit être précédé d'un caractère d'échappement ou mis entre guillemets
lorsque spécifié en option de ligne de commande, mais pas dans le fichier de
configuration.
Les adresses matérielles coïncident en principe avec n'importe
quel type de réseau (ARP), mais il est possible de les limiter à un seul type
ARP en les précédant du type ARP (en Hexadécimal) et de "-". Ainsi
.B --dhcp-host=06-00:20:e0:3b:13:af,1.2.3.4
coïncidera uniquement avec des adresses matérielles Token-Ring, puisque le type
ARP pour une adresse Token-Ring est 6.
Un cas spécial, pour IPv4, correspond à l'inclusion d'une ou plusieurs adresses
matérielles, c-à-d :
.B --dhcp-host=11:22:33:44:55:66,12:34:56:78:90:12,192.168.0.2.
Cela permet à une adresse IP d'être associé à plusieurs adresses
matérielles, et donne à dnsmasq la permission d'abandonner un bail DHCP
attribué à l'une de ces adresses lorsqu'une autre adresse dans la liste