4.6. Configuring DNS

Overview

Function Introduction

The DNS protocol controls the Domain Name System (DNS), a distributed database with which you can map hostnames to IP addresses. When you configure DNS on your switch, you can substitute the hostname for the IP address with all IP commands, such as ping, telnet, connect, and related Telnet support operations. IP defines a hierarchical naming scheme that allows a device to be identified by its location or domain. Domain names are pieced together with periods (.) as the delimiting characters. To keep track of domain names, IP has defined the concept of a domain name server, which holds a cache (or database) of names mapped to IP addresses. To map domain names to IP addresses, you must first identify the hostnames, specify the name server that is present on your network, and enable the DNS.

Principle Description

N/A

Configuration

image

Fig. 4.8 DNS

step 1 Enter the configure mode

Switch# configure terminal

step 2 Set the dns domain name and dns server address

Switch(config)# dns domain server1
Switch(config)# dns server 202.100.10.20

step 3 Set static hostname-to-address mappings (optional)

Switch(config)# ip host www.example1.com 192.0.2.141

step 4 Validation

Switch# show dns server
Current DNS name server configuration:
Server IP Address
--------------------------------------------------------------

1 nameserver 202.100.10.20

Application cases

N/A