Configurazione

I file di configurazione di DNS sono memorizzati all'interno della directory /etc/bind. Il file di configurazione principale è /etc/bind/named.conf. Il contenuto del file di configurazione predefinito è mostrato di seguito:

// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the 
// structure of BIND configuration files in Debian, *BEFORE* you customize 
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";

// prime the server with knowledge of the root servers
zone "." {
	type hint;
	file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
	type master;
	file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
	type master;
	file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
	type master;
	file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
	type master;
	file "/etc/bind/db.255";
};

// zone "com" { type delegation-only; };
// zone "net" { type delegation-only; };

// From the release notes:
//  Because many of our users are uncomfortable receiving undelegated answers
//  from root or top level domains, other than a few for whom that behaviour
//  has been trusted and expected for quite some length of time, we have now
//  introduced the "root-delegations-only" feature which applies delegation-only
//  logic to all top level domains, and to the root domain.  An exception list
//  should be specified, including "MUSEUM" and "DE", and any other top level
//  domains from whom undelegated responses are expected and trusted.
// root-delegation-only exclude { "DE"; "MUSEUM"; };

include "/etc/bind/named.conf.local";

La riga include specifica il nome del file che contiene le opzioni DNS. La riga directory nel file di opzioni indica a DNS dove cercare i file. Tutti i file utilizzati da BIND sono relativi a questa directory.

Il file /etc/bind/db.root elenca i server dei nomi principali nel mondo. I server cambiano nel tempo e il file /etc/bind/db.root deve essere aggiornato.

La sezione zone definisce un server master, memorizzato in un file menzionato nel campo «file». Ogni file di zona contiene tre record di risorse (RR, Resource Records): un SOA RR, un NS RR e un PTR RR. SOA sta per «Start Of Authority». Il simbolo «@» è una speciale notazione indicante l'origine. NS è il «Name Server RR». PTR è il «Domain Name Pointer». Per avviare il server DNS, eseguire il seguente comando a un prompt di terminale:

sudo /etc/init.d/bind9 start

Per maggiori informazioni, consultare la documentazione presente nei riferimenti.