DHCP and DNS Configuration


The Dynamic Host Configuration Protocol is networking protocol to dynamically assign ip addresses and other network parameters likeDefault Gateway information along with TFTP and DNS addresses to hosts.We use DHCP because in a large Enterprise where we have thousands of hosts and all requiresip address to communicate.It is not prudent to manually assign the ip address one by one.

Whereas DNS stands for Domain Name System, it is used to translate the domain name into ip addresses.Because it is easy to remember name rather than remembering ip addresses of the domains. We assign the DNS server ip address when we assign ip address to host. We have two types of DNS servers.One is root servers which contain the complete database of domain names and IP addresses and others are owned by businesses or Internet Service Providers (ISPs). We can make our cisco router as a dns server to provide address translation locally in the lan.

Configuration of DHCP on a Cisco router

To enable the CiscoIOS DHCP Server and Relay Agent Features, we type service dhcp at configuration mode

Router(config)# service dhcp

Then we create a pool of addresses and also configure the other network parameters under this pool so that when an ip is assigned to a host this pool also deliever the parmeters to host.

Router(config)#ipdhcp poolname[Create a name for the dhcp pool]

Router(dhcp-config)# network{network-number} [mask |/prefix length] [Defines the network range of pool]

Router(dhcp-config)# dns-server{address}[Define the ip address of dns server which is going to be assigned]

Router(dhcp-config)# default-routeraddress[Address of the default router for host ]

Example dhcp configuration for the image shown:

ipdhcp pool central
network 11.0.0.0 255.255.255.0
dns-server 11.1.1.1
default router 11.1.1.2

Configuration of dns on cisco routers

First we have to enable the dns server and then assign the address to dns server:

Router(config)# ipdns server

To enable the dns server on router

Router(config)# ip name server {address}

To specify any external dns server to resolve the name queries

Router(config)# ip host {name} {Address}

Binding of ip addresses to name which are going to be resolved

Router(config)# ipdomainlookup

To enable the address translation