doc:appunti:linux:sa:dhcp
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:linux:sa:dhcp [2012/09/15 15:28] – [Configurazione del server DNS] niccolo | doc:appunti:linux:sa:dhcp [2024/05/28 10:31] (current) – [Modificare manualmente il file di zona] niccolo | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Dynamic DNS con DHCP ====== | ====== Dynamic DNS con DHCP ====== | ||
| - | La presente configurazione funziona su una Debian  | + | La presente configurazione funziona su una Debian  | 
| + | |||
| + | ===== Configurazione del server DNS ===== | ||
| + | |||
| + | Il server DNS (bind9) deve essere configurato per **accettare le modifiche alla zona** tramite chiave di autenticazione [[wp> | ||
| + | |||
| + | < | ||
| + | tsig-keygen -a hmac-md5 lan.rigacci.org > / | ||
| + | chmod 640 / | ||
| + | </ | ||
| + | |||
| + | La chiave avrà un contenuto random codificato base64: | ||
| + | |||
| + | < | ||
| + | key " | ||
| + | algorithm hmac-md5; | ||
| + |         secret " | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | Il file con la chiave deve essere incluso nella configurazione di bind e nella sezione relativa alla zona si dichiara che sono consentite le modifiche a chi è in possesso della chiave: | ||
| + | |||
| + | < | ||
| + | include "/ | ||
| + | |||
| + | zone " | ||
| + | type master; | ||
| + |     file " | ||
| + | allow-transfer { 192.168.3.1; }; | ||
| + |     allow-update { key " | ||
| + | max-journal-size 150k; | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | ===== Test modifica dinamica ===== | ||
| + | |||
| + | Con il comando **'' | ||
| + | |||
| + | < | ||
| + | nsupdate -v -d | ||
| + | > server 192.168.3.1 | ||
| + | > key lan.rigacci.org ZJu34t3AgaWXfmRSkjpqhA== | ||
| + | > zone lan.rigacci.org | ||
| + | > update add test.lan.rigacci.org. 3600 A 192.168.3.123 | ||
| + | > update add 123.3.168.192.in-addr.arpa 600 IN PTR test.lan.rigacci.org. | ||
| + | > show | ||
| + | > send | ||
| + | </ | ||
| + | |||
| + | In alternativa al comando interattivo  | ||
| + | |||
| + | Oltre al comando **add** è opportuno utilizzare il comando **del** per rimuovere i nomi non più necessari dalla zona. | ||
| + | |||
| + | ===== Configurazione del server DHCP ===== | ||
| In **''/ | In **''/ | ||
| Line 8: | Line 61: | ||
| ddns-updates  | ddns-updates  | ||
| ddns-update-style  | ddns-update-style  | ||
| - | ddns-domainname  | + | ddns-domainname  | 
| update-static-leases on; | update-static-leases on; | ||
| update-optimization  | update-optimization  | ||
| Line 19: | Line 72: | ||
| < | < | ||
| subnet 192.168.3.0 netmask 255.255.255.0 { | subnet 192.168.3.0 netmask 255.255.255.0 { | ||
| - |     key rndc-key  | + |     key lan.rigacci.org  | 
| algorithm hmac-md5; | algorithm hmac-md5; | ||
| - | secret "TXlWZXJ5U2VjcmV0Cg=="; | + | secret "ZJu34t3AgaWXfmRSkjpqhA==" | 
| }; | }; | ||
| - | zone my.rigacci.org. { | + | zone lan.rigacci.org. { | 
|         primary 192.168.2.2; |         primary 192.168.2.2; | ||
| - | key rndc-key; | + | key lan.rigacci.org; | 
| } | } | ||
| zone 3.168.192.in-addr.arpa. { | zone 3.168.192.in-addr.arpa. { | ||
|         primary 192.168.2.2; |         primary 192.168.2.2; | ||
| - | key rndc-key; } | + | key lan.rigacci.org; } | 
| } | } | ||
| </ | </ | ||
| Line 45: | Line 98: | ||
| </ | </ | ||
| - | **NOTA**: Togliere dai file di zona eventuali record inseriti manualmente che devono invece essere gestiti dinamicamente. | ||
| - | |||
| - | ===== Configurazione del server DNS ===== | ||
| - | |||
| - | L' | ||
| - | |||
| - | < | ||
| - | key rndc-key { | ||
| - | algorithm hmac-md5; | ||
| - |     secret " | ||
| - | }; | ||
| - | |||
| - | zone " | ||
| - | type master; | ||
| - |     file " | ||
| - |     allow-transfer { 192.168.3.1; | ||
| - |     allow-update { key " | ||
| - | max-journal-size 150k; | ||
| - | }; | ||
| - | </ | ||
| ===== Modificare manualmente il file di zona ===== | ===== Modificare manualmente il file di zona ===== | ||
| Line 73: | Line 106: | ||
| < | < | ||
| - | rndc freeze  | + | rndc freeze  | 
| </ | </ | ||
| Line 79: | Line 112: | ||
| < | < | ||
| - | rndc unfreeze  | + | rndc unfreeze  | 
| </ | </ | ||
| - | ===== Test modifica dinamica ===== | ||
| - | Con il comando **'' | ||
| - | |||
| - | < | ||
| - | nsupdate | ||
| - | > server 192.168.2.2   | ||
| - | > key rndc-key TXlWZXJ5U2VjcmV0Cg== | ||
| - | > zone 3.168.192.in-addr.arpa | ||
| - | > update add 36.3.168.192.in-addr.arpa 600 IN PTR lacie2.my.rigacci.org. | ||
| - | > send | ||
| - | </ | ||
doc/appunti/linux/sa/dhcp.1347715724.txt.gz · Last modified:  by niccolo
                
                