0% found this document useful (0 votes)
319 views

DNS Configuration

DNS cofiguration ;practice lab

Uploaded by

Asad Ul Hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
319 views

DNS Configuration

DNS cofiguration ;practice lab

Uploaded by

Asad Ul Hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Lab ID: 9.9K514A200.SAI1.

Stand-Alone Lab: Configuring DNS


Objective
Learn how to configure a router, switch, and PC to use Domain Name System (DNS). You will also learn
how to edit a PC’s hosts file and observe name resolution.

Lab Topology
The topology diagram below represents the NetMap in the Simulator.
Fa 0/0 Fa 0/12

Router1 Switch1
Fa 0/1 Fa 0/2

PC1 PC2

Command Summary
Command Description
bedit filename is used in NetSim to open a file from a workstation
configure terminal enters global configuration mode from privileged EXEC mode
enable enters privileged EXEC mode
end ends and exits configuration mode
exit exits one level in the menu structure
hostname host-name sets the device name
interface type number changes from global configuration mode to interface
configuration mode
ip address ip-address subnet-mask assigns an IP address to an interface
ipconfig /all is used in NetSim to display the IP addresses and Media
Access Control (MAC) address on a PC workstation
ipconfig /dg ip-address is used in NetSim to assign a default gateway IP address to a
workstation interface
ipconfig /ip ip-address subnet-mask is used in NetSim to assign an IP address and subnet mask to
a workstation interface

1 Boson NetSim Lab Manual


Command Description
ipconfig /dns ip-address is used in NetSim on a workstation to set the primary DNS
server
ip dns server enables the DNS server on a router
ip domain-lookup enables the DNS lookup feature
ip host host-name ip-address configures a static host-name–to–address mapping in the host
cache of a device
ip name-server ip-address configures the name server for the device
no shutdown enables an interface
ping [ip-address | host-name] sends an Internet Control Message Protocol (ICMP) echo
request to the specified address
show ip interface brief displays a brief summary of interface status and configuration
show running-config displays the active configuration file

The IP addresses and subnet masks used in this lab are shown in the tables below:

IP Addresses
Device Interface IP Address Subnet Mask
Router1 FastEthernet 0/0 10.0.0.1 255.255.255.0
Switch1 VLAN 1 10.0.0.2 255.255.255.0

Device IP Address Subnet Mask Default Gateway


PC1 10.0.0.100 255.255.255.0 10.0.0.1
PC2 10.0.0.101 255.255.255.0 10.0.0.1

Lab Tasks
Task 1: Perform Initial Configurations
This task involves configuring all four devices, verifying your configuration, and verifying connectivity.
1. On Router1, configure a host name of Router1, enable interface FastEthernet 0/0, and assign
interface FastEthernet 0/0 the appropriate IP address and subnet mask; refer to the IP Addresses
table.

2. On Switch1, configure a host name of Switch1 and assign interface VLAN 1 the appropriate IP
address and subnet mask; refer to the IP Addresses table.

3. On PC1 and PC2, configure the appropriate IP address, subnet mask, and default gateway; refer to
the IP Addresses table.

2 Boson NetSim Lab Manual


4. Verify the IP address and subnet mask using the show ip interface brief command on Router1 and
Switch1.

5. On Router1, verify network connectivity by issuing a ping to Switch1 (10.0.0.2), PC1 (10.0.0.100),
and PC2 (10.0.0.101).

Task 2: Configure DNS


This task involves observing network behavior before configuring DNS and configuring a DNS server.
1. From Switch1, ping Router1 by using the name of the host (Router1) instead of Router1’s IP
address. Does the ping succeed or fail? Why? _________________________________________
______________________________________________________________________________

2. On Router1, enable the DNS server feature.

3. Configure Router1 with two host-table entries: Router1 with an IP address 10.0.0.1 and Switch1
with an IP address 10.0.0.2.

4. Configure Switch1 to use Router1 as its DNS server, and enable host-name–to–address translation.

5. From Switch1, ping Router1 by using the name of the host (Router1) instead of Router1’s IP
address to verify your configuration.

Task 3: Edit a PC Hosts File


This task involves editing a PC’s hosts file and verifying the name resolution.
1. What is the purpose of the hosts file on a PC? _________________________________________
______________________________________________________________________________

2. You can open a basic text editor on a NetSim-simulated PC by issuing the bedit filename command.
Open PC1’s hosts file. The name of the file is hosts.

3. Add two entries to the hosts file on PC1: Router1 with an IP address 10.0.0.1 and Switch1 with an
IP address 10.0.0.2.

4. Save the hosts file by clicking the Save (F11) menu item.

5. Close the text editor by clicking the Close (F6) menu item.

6. Using the name of the host instead of the IP address, issue a ping from PC1 to Router1 (Router1)
and Switch1 (Switch1).

3 Boson NetSim Lab Manual


Task 4: Configure DNS on a NetSim PC
This task involves configuring and verifying a NetSim-simulated PC to use a DNS server.
1. On PC2, view IP configuration information. Is there a Primary or Secondary DNS server configured?
______________________________________________________________________________

2. In NetSim, you can configure a PC with a Primary DNS server by issuing the ipconfig /dns ip-
address command. A Secondary DNS server can be configured by using the same command and
supplying a second IP address. Configure PC2 to use 10.0.0.1 as its Primary DNS server.

3. On PC2, verify your configuration.

4. From PC2, ping Router1 and Switch1 by using host names (Router1 and Switch1).

4 Boson NetSim Lab Manual


Lab Solutions
Task 1: Perform Initial Configurations
1. You should issue the following commands on Router1 to configure a host name of Router1, to
enable interface FastEthernet 0/0, and to assign interface FastEthernet 0/0 the appropriate IP
address and subnet mask:

Router>enable
Router#configure terminal
Router(config)#hostname Router1
Router1(config)#interface fastethernet 0/0
Router1(config-if)#ip address 10.0.0.1 255.255.255.0
Router1(config-if)#no shutdown

2. You should issue the following commands on Switch1 to configure a host name of Switch1 and to
assign interface VLAN 1 the appropriate IP address and subnet mask:

Switch>enable
Switch#configure terminal
Switch(config)#hostname Switch1
Switch1(config)#interface vlan 1
Switch1(config-if)#ip address 10.0.0.2 255.255.255.0

3. You should issue the following commands on PC1 and PC2 to configure the appropriate IP address,
subnet mask, and default gateway:

On PC1:
C:>ipconfig /ip 10.0.0.100 255.255.255.0
C:>ipconfig /dg 10.0.0.1

On PC2:
C:>ipconfig /ip 10.0.0.101 255.255.255.0
C:>ipconfig /dg 10.0.0.1

4. You should issue the show ip interface brief command on Router1 and Switch1 to verify IP
addresses and subnet masks. Sample output is below:

Router1(config-if)#end
Router1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Serial0/0 unassigned YES unset administratively down down
Serial0/1 unassigned YES unset administratively down down
FastEthernet0/0 10.0.0.1 YES unset up up
FastEthernet0/1 unassigned YES unset administratively down down

Switch1(config-if)#end
Switch1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Vlan 1 10.0.0.2 YES unset up up
<output omitted>

5 Boson NetSim Lab Manual


5. From Router1, pings to Switch1 (10.0.0.2), PC1 (10.0.0.100), and PC2 (10.0.0.101) should be
successful:

Router1#ping 10.0.0.2

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

Router1#ping 10.0.0.100

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 10.0.0.100, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

Router1#ping 10.0.0.101

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 10.0.0.101, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

Task 2: Configure DNS


1. A ping from Switch1 to Router1 by using the host name Router1 fails because Switch1 cannot
resolve the name Router1 into an IP address.

Switch1#ping Router1
% Unrecognized host or address, or protocol not running.

2. You should issue the ip dns server command on Router1 to enable the DNS server features and to
configure it to respond to DNS queries:

Router1#configure terminal
Router1(config)#ip dns server

3. You should issue the following commands to configure Router1 with the appropriate host-table
entries:

Router1(config)#ip host Router1 10.0.0.1


Router1(config)#ip host Switch1 10.0.0.2

4. You should issue the following commands on Switch1 to use Router1 as its DNS server and enable
host-name–to–address translation:

Switch1#configure terminal
Switch1(config)#ip name-server 10.0.0.1
Switch1(config)#ip domain-lookup

6 Boson NetSim Lab Manual


5. A ping from Switch1 to Router1 by using the host name Router1 should succeed.

Switch1(config)#end
Switch1#ping Router1

Translating “Router1”... domain server (10.0.0.1) [OK]

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

Task 3: Edit a PC Hosts File


1. The hosts file on a PC is a plain-text file used by the operating system to map host names to IP
addresses.

2. You should issue the bedit hosts command on PC1 to open PC1’s hosts file.

C:>bedit hosts

3. You should add the two lines in the screenshot below to add a host name entry Router1 with an IP
address 10.0.0.1 and a host name entry Switch1 with an IP address 10.0.0.2 to the hosts file on
PC1:

4. You should click the Save (F11) menu item to save the hosts file on PC1.

7 Boson NetSim Lab Manual


5. You should click the Exit (F6) menu item to close the text editor for PC1.

6. Pings from PC1 to Router1 and Switch1 by using host names should now be successful.

C:>ping Router1

Pinging Router1 [10.0.0.1] with 32 bytes of data:


Reply from 10.0.0.1: bytes=32 time=48ms TTL=241
Reply from 10.0.0.1: bytes=32 time=55ms TTL=241
Reply from 10.0.0.1: bytes=32 time=60ms TTL=241
Reply from 10.0.0.1: bytes=32 time=52ms TTL=241
Reply from 10.0.0.1: bytes=32 time=51ms TTL=241

Ping statistics for 10.0.0.1:


Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 48ms, Maximum = 60ms, Average = 53ms

C:>ping Switch1

Pinging Switch1 [10.0.0.2] with 32 bytes of data:


Reply from 10.0.0.2: bytes=32 time=48ms TTL=241
Reply from 10.0.0.2: bytes=32 time=66ms TTL=241
Reply from 10.0.0.2: bytes=32 time=54ms TTL=241
Reply from 10.0.0.2: bytes=32 time=65ms TTL=241
Reply from 10.0.0.2: bytes=32 time=71ms TTL=241

Ping statistics for 10.0.0.2:


Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 48ms, Maximum = 71ms, Average = 61ms

8 Boson NetSim Lab Manual


Task 4: Configure DNS on a NetSim PC
1. You should issue the ipconfig /all command on PC2 to view IP configuration information. The
lack of output on the DNS Servers line indicates there is not a Primary or Secondary DNS server
configured. Sample output is below:

C:>ipconfig /all

<output omitted>
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.0.0.101
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.0.1
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek RTL8139/810X Family PCI
FastEthernet NIC
Physical Address. . . . . . . . . : 000C.3832.8668
DHCP Enabled. . . . . . . . . . . : YES

DNS Servers . . . . . . . . . . . :

2. You should issue the following command on PC2 to configure it to use 10.0.0.1 as its Primary DNS
server:

C:>ipconfig /dns 10.0.0.1

3. You should issue the following command on PC2 to verify IP configuration information. Sample
output is below:

C:>ipconfig /all

<output omitted>
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.0.0.101
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.0.1
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek RTL8139/810X Family PCI
FastEthernet NIC
Physical Address. . . . . . . . . : 000C.3832.8668
DHCP Enabled. . . . . . . . . . . : YES

DNS Servers . . . . . . . . . . . : 10.0.0.1

9 Boson NetSim Lab Manual


4. Pings from PC2 to Router1 and Switch1 by using host names should now be successful.

C:>ping Router1

Pinging Router1 [10.0.0.1] with 32 bytes of data:


Reply from 10.0.0.1: bytes=32 time=69ms TTL=241
Reply from 10.0.0.1: bytes=32 time=60ms TTL=241
Reply from 10.0.0.1: bytes=32 time=68ms TTL=241
Reply from 10.0.0.1: bytes=32 time=61ms TTL=241
Reply from 10.0.0.1: bytes=32 time=63ms TTL=241

Ping statistics for 10.0.0.1:


Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 60ms, Maximum = 69ms, Average = 64ms

C:>ping Switch1

Pinging Switch1 [10.0.0.2] with 32 bytes of data:


Reply from 10.0.0.2: bytes=32 time=59ms TTL=241
Reply from 10.0.0.2: bytes=32 time=54ms TTL=241
Reply from 10.0.0.2: bytes=32 time=52ms TTL=241
Reply from 10.0.0.2: bytes=32 time=49ms TTL=241
Reply from 10.0.0.2: bytes=32 time=58ms TTL=241

Ping statistics for 10.0.0.2:


Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 49ms, Maximum = 59ms, Average = 54ms

10 Boson NetSim Lab Manual


Sample Configuration Script
Router1
Router1#show running-config
Building configuration...
Current configuration : 758 bytes
!
Version 12.3
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router1
!
ip subnet-zero
!
ip cef
no ip domain-lookup
ip host Router1 10.0.0.1
ip host Switch1 10.0.0.2
!
interface Serial0/0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0/1
no ip address
no ip directed-broadcast
shutdown
!
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.0
no ip directed-broadcast
!
interface FastEthernet0/1
no ip address
no ip directed-broadcast
shutdown
!
ip classless
no ip http server
!
ip dns server
!
line con 0
line aux 0
line vty 0 4
!
no scheduler allocate
end

Copyright © 1996–2014 Boson Software, LLC. All rights reserved. NetSim software and documentation are protected by copyright law.

11 Boson NetSim Lab Manual

You might also like