Está en la página 1de 4

Laboratrio 2 AIT O DNS com dois domnios

Criar e configurar no DNS o domnio teste.com e as seguintes redes: www ftp pop3 smtp 200.221.2.10 201.20.35.11 10.120.2.45 172.16.2.41

Configurao dos arquivos principais #vi /etc/hostname


srv

#vi /etc/hosts
127.0.0.1 192.168.10.5 localhost.localdomain srv.noite.int.br localhost srv

#vi /etc/network/interfaces
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.10.5 netmask 255.255.255.0 network 192.168.10.0 broadcast 192.168.10.255 gateway 192.168.10.1 dns-nameservers 192.168.10.5 dns-search noite.int.br

#vi /etc/resolv.conf
search noite.int.br domain noite.int.br nameserver 192.168.10.5

Restartando o sistema #/etc/init.d/networking restart Efetuando os testes bsicos #hostname f


srv.noite.int.br

#hostname d
noite.int.br

#hostname i

Autores: Prof. Felipe Costa Reis e Miguel A. Marquez G.

192.168.10.5

#hostname a
srv

Configurando os arquivos do DNS #cd /etc/bind/ #vi named.conf.local


// // Do any local configuration here // // Consider adding the 1918 zones here, if they are not used in your // organization //include "/etc/bind/zones.rfc1918"; zone noite.int.br { type master; file "/etc/bind/db.noite.int.br"; }; zone 10.168.192.in-addr.arpa { type master; file "/etc/bind/db.192.168.10"; }; zone teste.com { type master; file "/etc/bind/db.teste.com"; }; zone 2.221.200.in-addr.arpa { type master; file "/etc/bind/db.200.221.2"; }; zone 35.20.201.in-addr.arpa { type master; file "/etc/bind/db.201.20.35"; }; zone 10.in-addr.arpa { type master; file "/etc/bind/db.10"; }; zone 16.172.in-addr.arpa { type master; file "/etc/bind/db.172.16"; };

Criando os arquivos de dados BD #cp db.empty db.noite.int.br #cp db.empty db.200.221.2 #cp db.empty db.201.20.35 #cp db.empty db.10
Autores: Prof. Felipe Costa Reis e Miguel A. Marquez G.

#cp db.empty db.172.16

#vi db.noite.int.br
$TTL @ 86400 IN SOA srv.noite.int.br. root.noite.int.br. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 86400 ) ; Negative Cache TTL

; @ srv www

IN IN IN

NS srv.noite.int.br. A 192.168.10.5 CNAME srv.noite.int.br.

#vi db.192.168.10
$TTL @ 86400 IN SOA srv.noite.int.br. root.noite.int.br. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 86400 ) ; Negative Cache TTL srv.noite.int.br. srv.noite.int.br.

; @ 5

IN IN

NS PTR

Para o Domnio Teste.com #vi db.teste.com


$TTL @ 86400 IN SOA srv.noite.int.br. root.noite.int.br. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 86400 ) ; Negative Cache TTL srv.noite.int.br. 200.221.2.10 201.20.35.11 10.120.2.45 172.16.2.41

; @ www ftp pop3 smtp

IN IN IN IN IN

NS A A A A

Arquivos reversos #vi db.200.221.2


$TTL @ 86400 IN SOA srv.noite.int.br. root.noite.int.br. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 86400 ) ; Negative Cache TTL

Autores: Prof. Felipe Costa Reis e Miguel A. Marquez G.

; @ 10

IN IN

NS PTR

srv.noite.int.br. www.teste.com.

#vi db.201.20.35
$TTL @ 86400 IN SOA srv.noite.int.br. root.noite.int.br. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 86400 ) ; Negative Cache TTL srv.noite.int.br. ftp.teste.com.

; @ 11

IN IN

NS PTR

#vi db.10
$TTL @ 86400 IN SOA srv.noite.int.br. root.noite.int.br. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 86400 ) ; Negative Cache TTL NS PTR srv.noite.int.br. pop3.teste.com.

; @ 45.2.120

IN IN

#vi db.172.16
$TTL @ 86400 IN SOA srv.noite.int.br. root.noite.int.br. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 86400 ) ; Negative Cache TTL srv.noite.int.br. smtp.teste.com.

; @ 41.2

IN IN

NS PTR

Restartando o sistema #/etc/init.d/bind9 restart Testando a resoluo #nslookup www.teste.com #nslookup ftp.teste.com #nslookup pop3.teste.com #nslookup smtp.teste.com #nslookup 200.221.2.10 #nslookup 201.20.35.11 #nslookup 10.120.2.45 #nslookup 172.16.2.41

Autores: Prof. Felipe Costa Reis e Miguel A. Marquez G.

También podría gustarte