Os ficheiros de configuração DNS são guardados no directório /etc/bind
. O ficheiro de configuração principal é o /etc/bind/named.conf
. O conteúdo do ficheiro de configuração por omissão é mostrado de seguida:
// 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";
A linha include especifica o ficheiro que contém as opções de DNS. A linha directory no ficheiro de opções indica ao DNS onde procurar os ficheiros. Todos os ficheiros que o BIND usa serão relativos a este directório.
The file named /etc/bind/db.root
describes the root name servers in the world. The servers
change over time, so the
/etc/bind/db.root
file must be maintained
now and then.
A secção zone define um servidor mestre, e está colocada num ficheiro mencionado com a etiqueta file. Cada ficheiro de zona contém três registos de recurso (RRs): um SOA RR, um NS RR e um PTR RR. O SOA é o diminutivo de Start of Authority - Início de Autoridade. O "@" é uma anotação especial indicando a origem. NS é o RR de Servidor de Nome. O PTR é o apontador do nome de domínio. Para iniciar o servidor DNS, digite o seguinte comando num terminal ou linha de comandos:
sudo /etc/init.d/bind9 start
Pode recorrer à documentação mencionada na secção de referências para detalhes.