Catalyst 4500 Series Software Configuration Guide, 7.5
Configuring DNS

Table Of Contents

Configuring DNS

Understanding How DNS Works

Default DNS Configuration

Configuring DNS

Setting Up and Enabling DNS

Clearing a DNS Server

Clearing the DNS Domain Name

Disabling DNS


Configuring DNS


This chapter describes how to configure the Domain Name System (DNS) on the Catalyst enterprise LAN switches.


Note For complete syntax and usage information for the commands used in this chapter, refer to the Command Reference—Catalyst 4000 Family, Catalyst 2948G, and Catalyst 2980G Switches.


This chapter consists of these major sections:

Understanding How DNS Works

Default DNS Configuration

Configuring DNS

Understanding How DNS Works

DNS is a distributed database with which you can map host names to IP addresses through the DNS protocol from a DNS server. When you configure DNS on the switch, you can substitute the host name for the IP address with all IP commands, such as ping, telnet, upload, and download.

To use DNS, you must have a DNS name server on your network.

You can specify a primary DNS name server on the switch as well as two backup servers. The first server specified is the primary unless you explicitly identify the primary server. The switch sends DNS queries to the primary server first. If the query to the primary server fails, the backup servers are queried.

Default DNS Configuration

Table 35-1 shows the default DNS configuration.

Table 35-1 Default DNS Configuration  

Feature
Default Value

DNS enable state

Disabled

DNS default domain name

Null

DNS servers

None specified


Configuring DNS

The following sections describe how to configure DNS:

Setting Up and Enabling DNS

Clearing a DNS Server

Clearing the DNS Domain Name

Disabling DNS

Setting Up and Enabling DNS

To set up and enable DNS on the switch, perform this task in privileged mode:

 
Task
Command

Step 1 

Specify the IP address of one or more DNS servers.

set ip dns server ip_addr [primary]

Step 2 

Set the domain name.

set ip dns domain name

Step 3 

Enable DNS.

set ip dns enable

Step 4 

Verify the DNS configuration.

show ip dns [noalias]

This example shows how to set up and enable DNS on the switch and verify the configuration:

Console> (enable) set ip dns server 10.2.2.1
10.2.2.1 added to DNS server table as primary server.
Console> (enable) set ip dns server 10.2.24.54 primary
10.2.24.54 added to DNS server table as primary server.
Console> (enable) set ip dns server 10.12.12.24
10.12.12.24 added to DNS server table as backup server.
Console> (enable) set ip dns domain corp.com
Default DNS domain name set to corp.com
Console> (enable) set ip dns enable
DNS is enabled
Console> (enable) show ip dns
DNS is currently enabled.
The default DNS domain name is: corp.com

DNS name server                            status
----------------------------------------   -------
dns_serv2
dns_serv1                                  primary
dns_serv3
Console> (enable)

Clearing a DNS Server

To clear DNS servers from the DNS server table, perform this task in privileged mode:

 
Task
Command

Step 1 

Remove one or all of the DNS servers from the table.

clear ip dns server [ip_addr | all]

Step 2 

Verify the DNS configuration.

show ip dns [noalias]

This example shows how to clear a DNS server from the DNS server table:

Console> (enable) clear ip dns server 10.12.12.24
10.12.12.24 cleared from DNS table
Console> (enable)

This example shows how to clear all of the DNS servers from the DNS server table:

Console> (enable) clear ip dns server all
All DNS servers cleared
Console> (enable)

Clearing the DNS Domain Name

To clear the default DNS domain name, perform this task in privileged mode:

 
Task
Command

Step 1 

Clear the default DNS domain name.

clear ip dns domain

Step 2 

Verify the DNS configuration.

show ip dns [noalias]

This example shows how to clear the default DNS domain name:

Console> (enable) clear ip dns domain
Default DNS domain name cleared.
Console> (enable)

Disabling DNS

To disable DNS, perform this task in privileged mode:

 
Task
Command

Step 1 

Disable DNS on the switch.

set ip dns disable

Step 2 

Verify the DNS configuration.

show ip dns [noalias]

This example shows how to disable DNS on the switch:

Console> (enable) set ip dns disable
DNS is disabled
Console> (enable)