Linux: Configurando um servidor DNS

Vamos configurar um servidor DNS Bind para resolução de nomes da nossa rede.

Na configuração abaixo eu faço a atualização dinâmica no servidor de DNS Bind e suporte ao Active Directory.

Observação: Se você não utilizar o Active Directory exclua as entradas na named.conf e pule o passo 4

Instalando o Servidor BIND
Opcional: Primeiro vamos instalar o servidor DHCP


 * 1) yum -y install bind

Configurando o Servidor DNS BIND
Na configuração abaixo eu faço a atualização dinâmica no servidor de DNS Bind e suporte ao Active Directory

1. Configurando o /etc/named.conf -> BIND: Configurando o arquivo named.conf

2. Configurando o domínio meudominio.com.br -> BIND: Configurando o arquivo de Dominio

3. Configurando o reverso -> BIND: Configurando o arquivo de DNS Reverso

4. Configurando os arquivos para suporte ao Active Directory -> BIND: Configurando o suporte ao Active Directory

Conclusão
Reinicie o servidor para pegar as configurações


 * 1) service named restart

Se tudo correr bem, no /var/log/messages deve aparecer algo semelhante a:

Feb 22 11:58:42 myserver named[24585]: starting BIND 9.3.3rc2 -u named Feb 22 11:58:42 myserver named[24585]: found 2 CPUs, using 2 worker threads Feb 22 11:58:42 myserver named[24585]: loading configuration from '/etc/named.conf' Feb 22 11:58:42 myserver named[24585]: listening on IPv4 interface lo, 127.0.0.1#53 Feb 22 11:58:42 myserver named[24585]: listening on IPv4 interface eth0, 192.168.1.10#53 Feb 22 11:58:42 myserver named[24585]: zone 'meudominio.com.br' allows updates by IP address, which is insecure Feb 22 11:58:42 myserver named[24585]: zone '1.168.192.in-addr.arpa' allows updates by IP address, which is insecure Feb 22 11:58:42 myserver named[24585]: zone '_msdcs.meudominio.com.br' allows updates by IP address, which is insecure Feb 22 11:58:42 myserver named[24585]: zone '_sites.meudominio.com.br' allows updates by IP address, which is insecure Feb 22 11:58:42 myserver named[24585]: zone '_tcp.meudominio.com.br' allows updates by IP address, which is insecure Feb 22 11:58:42 myserver named[24585]: zone '_udp.meudominio.com.br' allows updates by IP address, which is insecure Feb 22 11:58:42 myserver named[24585]: command channel listening on 127.0.0.1#953 Feb 22 11:58:42 myserver named[24585]: zone 0.in-addr.arpa/IN: loaded serial 42 Feb 22 11:58:42 myserver named[24585]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700 Feb 22 11:58:42 myserver named[24585]: zone 1.168.192.in-addr.arpa/IN: loaded serial 2008021903 Feb 22 11:58:42 myserver named[24585]: zone 255.in-addr.arpa/IN: loaded serial 42 Feb 22 11:58:42 myserver named[24585]: zone 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 1997022700 Feb 22 11:58:43 myserver named[24585]: zone meudominio.com.br/IN: loaded serial 2008022203 Feb 22 11:58:43 myserver named[24585]: zone _msdcs.meudominio.com.br/IN: loaded serial 2008022101 Feb 22 11:58:43 myserver named[24585]: zone _sites.meudominio.com.br/IN: loaded serial 2008022101 Feb 22 11:58:43 myserver named[24585]: zone _tcp.meudominio.com.br/IN: loaded serial 2008022101 Feb 22 11:58:43 myserver named[24585]: zone _udp.meudominio.com.br/IN: loaded serial 2008022101 Feb 22 11:58:43 myserver named[24585]: zone localdomain/IN: loaded serial 42 Feb 22 11:58:43 myserver named[24585]: zone localhost/IN: loaded serial 42 Feb 22 11:58:43 myserver named[24585]: running