User Tools

Site Tools


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:

  1. /etc/rcS.d/S38resolvconf
    Sostituisce /etc/resolv.conf con il link /etc/resolvconf/run/resolv.conf.
  2. /etc/rcS.d/S40networking
    Lo script /etc/network/if-up.d/000resolvconf, se trova la direttiva dns-nameservers in una istanza di interfaccia di /etc/network/interfaces, aggiunge le relative informazioni DNS a /etc/resolvconf/run/resolv.conf.
  3. /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:

  1. dnsmasq utilizza come forwarders i DNS dichiarati in /etc/network/interfaces, che sono stati copiati in /var/run/dnsmasq/resolv.conf.
  2. 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