doc:appunti:linux:sa:dnsmasq
This is an old revision of the document!
dnsmasq
Si tratta di un DNS server forwarder e DHCP server.
Il funzionamento congiunto di resolvconf
e dnsmasq
segue questa sequenza durante il boot:
/etc/rcS.d/S38resolvconf
Sostituisce/etc/resolv.conf
con il link/etc/resolvconf/run/resolv.conf
./etc/rcS.d/S40networking
Lo script/etc/network/if-up.d/000resolvconf
, se trova la direttivadns-nameservers
in una istanza di interfaccia di/etc/network/interfaces
, aggiunge le relative informazioni DNS a/etc/resolvconf/run/resolv.conf
./etc/rc2.d/S15dnsmasq
Se resolvconf è installato, viene registrato 127.0.0.1 come server DNS, associato all'interfaccia lo.
Lo script/etc/resolvconf/update.d/dnsmasq
scrive tutti i DNS registrati presso resolvconf in/var/run/dnsmasq/resolv.conf
, ad eccezione di 127.0.0.1 associato a lo. Il demone dnsmasq userà questi come forwarders.
Il demone resolvconf, trovando registrato il nameserver 127.0.0.1, non aggiungerà altri nameserver in resolv.conf.
Configurazione
In pratica quindi basta dichiarare i DNS forwarders con la direttiva dns-nameservers
nell'opportuna istanza di /etc/network/interfaces
, al termine del boot tutto dovrebbe essere configurato automaticamente:
- dnsmasq utilizza come forwarders i DNS dichiarati in
/etc/network/interfaces
, che sono stati copiati in/var/run/dnsmasq/resolv.conf
. - resolvconf imposta il solo
nameserver 127.0.0.1
in/etc/resolv.conf
.
In caso di nuove registrazioni presso resolvconf di altri server DNS (ad esempio quando viene attivata una connessione PPP), il file /var/run/dnsmasq/resolv.conf
viene aggiornato opportunamente, in modo che dnsmasq
utilizzi gli opportuni forwarders.
doc/appunti/linux/sa/dnsmasq.1312124248.txt.gz · Last modified: 2011/07/31 16:57 by niccolo