CCNA Labs DNS Server Configuration on GNS3 and Packet Tracer

Posted on 143 views

This is a continuation of Our CCNA Labs on GNS3 series. Last we configured SSH and Telnet Access Lab. The topologies shown here can be implemented on Cisco Packet Tracer as well.

Domain Name Service is what resolve hostnames to IP addresses. When you have DNS server running on your network, you don’t have to type the IP address of the host you want to connect to or ping as long as a hostname is set. You just type the hostname, Internet name or Fully qualified domain name(fqdn) and DNS server work out the rest for you. DNS Server listens on UDP port 53.

We’ll use topology shown below to setup DNS server. R1 will use R2 as DNS server to make DNS resolutions.


First, let’s begin with R1. We’ll setup hostname and IP related information.

R1 ip Configurations:

configure terminal
hostname R1
interface e0/0
ip address
no shut
do wr 

R2 IP and Hostname Configurations

config t
hostaname R2
int e0/0
ip address
no shut
do wr

Setting up R2 as DNS Server

config t
ip dns server
ip host

We mapped to ip address Currently, we don’t have, we could create loopback interface on R2 and assign ip

interface loopback 1
ip address

Let’s verify that loopback interface we just created is working.This will show us that the hostname correctly setup locally on R2.


Now it’s time to setup R1 to resolve hostnames using R2.On R1 type;

config terminal 
ip domain lookup
ip name-server

Set R1 to use R2 as the default gateway to get to the loopback interface on R2. So that after R1 resolve, it can reach through its default route (R2).

on R1 type:

config t
ip route

This tells our router that to get to any network not in its routing table, it’s next hop is which is our router R2.
We can turn on DNS udp port debug command so that we can see what’s going on on R1.

debug ip udp

Now on R1, do a ping to and you should get a success message.

ping repeat 3

If you captured the traffic, you’ll see DNS query and Answer as shown in Wireshark capture screenshot below.


Enjoy your GNS3 and Packer Tracer lab sessions.


Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.