Os arquivos de configuração do DNS são armazenados no diretório /etc/bind
. O arquivo de configuração principal é o /etc/bind/named.conf
. O conteúdo da configuração padrão está disposto abaixo:
// 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 nome do arquivo que contém as opções do DNS. A linha directory no arquivo de opções diz ao DNS onde procupar por arquivos. Todos os arquivos utilizados pelo BIND estão contidos nesse diretório.
O arquivo chamado /etc/bind/db.root
descreve os servidores de nome raízes no mundo. Os servidores mudam com o tempo, por isso o arquivo /etc/bind/db.root
precisa sempre ser mantido atualizado.
A seção zone define um servidor mestre, e ela é armazenado em um arquivo mencionado através da tag file. Cada zona contém 3 registros de recursos (RRs): um RR SOA, um RR NS, e um RR PTR. SOA é a abreviatura para Start of Authority, ou seja, Início da Autoridade. A "@" é uma notação especial que denota a origem. NS é a RR para Servidor de Nomes. PTR é Ponteiro para Servidor de Nomes. Para iniciar o servidor DNS, rode o seguinte comando apartir do prompt de um terminal:
sudo /etc/init.d/bind9 start
Você pode se referir à documentação mencionada na seção de referências para detalhes.