Saturday 29 September 2012

Setting Cisco router as DNS server /DNS client

In this tutorial we are going to set a cisco router as DNS server and other routers as DNS clients.Using GNS3 to make the configuration.The routers IOS is c3640 and there is one ethernet switch. I will put some detailed explanation if i can afford time soon but for the moment here is the topology:


CONFIGURATION

① Let's first set the ip address of each device

R1#conf t  
Enter configuration commands, one per line.  End with CNTL/Z. 
R1(config)#int f0/0  
R1(config-if)#ip add 10.10.10.1 255.255.255.0  
R1(config-if)#no shut 


R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int f0/0
R2(config-if)#ip add 10.10.10.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#

R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#int f0/0
R3(config-if)#ip add 10.10.10.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#

R4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#int f0/0
R4(config-if)#ip add 10.10.10.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#


② Let's set R1 to be the primary dns server
R4#conf t
R1(config)#ip dns server
R1(config)#ip dns primary siaka.com soa ns1.siaka.com shakoul.siaka.com
R1(config)#ip host siaka.com ns 10.10.10.1
R1(config)#ip host ns1 10.10.10.1
R1(config)#ip host R2 10.10.10.2
R1(config)#ip host R3 10.10.10.3
R1(config)#ip host R4 10.10.10.4

 - step 1 : set the router as a dns server with "ip dns server"
 - step 2 : set the dns zone with the following details:
  ※ siaka.com = domain name , ns1.siaka.com = dns server name ,
     shakoul.siaka.com= admin email
 - step 3: set an ns record for the dns server "ip host siaka.com ns 10.10.10.1"
 - step 4: create some A records for the rest of the network

③ Let's set the clients R2 to R4

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#no ip domain name lab.local
R2(config)#ip domain-lookup
R2(config)#ip name-server 10.10.10.1


R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#no ip domain name lab.local
R3(config)#ip domain-lookup
R3(config)#ip name-server 10.10.10.1

R4#conf t

Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#no ip domain name lab.local
R4(config)#ip domain-lookup
R4(config)#ip name-server 10.10.10.1

③ Let's ping all routers by name from R1 and from R2 to R4
 R1#ping R2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/47/80 ms
R1#ping R3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/40/88 ms
R1#ping R4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/40/88 ms
R1#


R2#ping ns1
Translating "ns1"...domain server (10.10.10.1) [OK]

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/60/120 ms
R2#ping R1
Translating "R1"...domain server (10.10.10.1) [OK]

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/27/52 ms
R2#ping R3
Translating "R3"...domain server (10.10.10.1) [OK]

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/65/132 ms
R2#ping R4
Translating "R4"...domain server (10.10.10.1) [OK]

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/32/52 ms
R2#