DNS

This chapter describes how to configure the Domain Name Server (DNS) client on the Cisco NX-OS device.

This chapter includes these sections:

DNS clients

DNS client

If your network devices require connectivity with devices in networks for which you do not control the name assignment, you can assign device names that uniquely identify your devices within the entire internetwork using the domain name server (DNS).

DNS uses a hierarchical scheme for establishing host names for network nodes, which allows local control of the segments of the network through a client-server scheme. The DNS system can locate a network device by translating the hostname of the device into its associated IP address.

On the Internet, a domain is a portion of the naming hierarchy tree that refers to general groupings of networks based on the organization type or geography. Domain names are pieced together with periods (.) as the delimiting characters. For example, Cisco is a commercial organization that the Internet identifies by a com domain, so its domain name is cisco.com. A specific hostname in this domain, the File Transfer Protocol (FTP) system, for example, is identified as ftp.cisco.com.

Name Servers

Name servers keep track of domain names and know the parts of the domain tree for which they have complete information. A name server may also store information about other parts of the domain tree. To map domain names to IP addresses in Cisco NX-OS, you must identify the hostnames, specify a name server, and enable the DNS service.

Cisco NX-OS allows you to statically map IP addresses to domain names. You can also configure Cisco NX-OS to use one or more domain name servers to find an IP address for a host name.

DNS operations

A name server handles client-issued queries to the DNS server for locally defined hosts within a particular zone by performing these actions:

  • An authoritative name server responds to DNS user queries for a domain name that is under its zone of authority by using the permanent and cached entries in its own host table. If the query is for a domain name that is under its zone of authority but for which it does not have any configuration information, the authoritative name server replies that no such information exists.

  • A name server that is not configured as the authoritative name server responds to DNS user queries by using information that it has cached from previously received query responses. If no router is configured as the authoritative name server for a zone, queries to the DNS server for locally defined hosts receive nonauthoritative responses.

Name servers answer DNS queries (forward incoming DNS queries or resolve internally generated DNS queries) according to the forwarding and lookup parameters configured for the specific domain.

High availability

Cisco NX-OS supports stateless restarts for the DNS client. After a reboot or supervisor switchover, Cisco NX-OS applies the running configuration.

Virtualization support

Cisco NX-OS supports multiple instances of the DNS clients that run on the same system. You can configure a DNS client. You can optionally have a different DNS client configuration in each virtual routing and forwarding (VRF) instance.

Prerequisites for DNS clients

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

Guidelines and limitations for DNS clients

The DNS client has theses configuration guidelines and limitations:

  • You configure the DNS client in a specific VRF. If you do not specify a VRF, Cisco NX-OS uses the default VRF.

  • Beginning with Cisco NX-OS Release 7.0(3)I5(1), DNS supports IPv6 addresses.

  • The source-interface feature for ip name-server CLI is supported on all the DME enabled platforms. Prior to NX-OS Release 10.4(3)F, DME is not supported on C92348GC-X. Therefore, source-interface option is not supported on this platform. However, source-interface option is supported on C92348GC-X, from NX-OS Release 10.4(3)F onwards.

Default settings for DNS clients

Default DNS client parameters

The table lists the default settings for DNS client parameters.

Parameters Default

DNS client

Enabled

Configure DNS clients

Configure DNS client

You can configure the DNS client to use a DNS server on your network.

Before you begin

Ensure that you have a domain name server on your network.

Procedure


Step 1

Use the configure terminal command to enter global configuration mode.

Example:

switch# configure terminal
switch(config)#

Step 2

Use the ip host name address1 [address2... address6] command to define up to six static hostname-to-address mappings in the hostname cache.

Example:

switch(config)# ip host cisco-rtp
192.0.2.1
The address can be either an IPv4 address or an IPv6 address.

Step 3

(Optional) Use the ip domain-name name [use-vrf vrf-name] command to define the default domain name that Cisco NX-OS uses to complete unqualified hostnames.

Example:

switch(config)# ip domain-name
myserver.com

You can optionally define a VRF that Cisco NX-OS uses to resolve this domain name if it cannot be resolved in the VRF that you configured this domain name under.

Cisco NX-OS appends the default domain name to any hostname that does not contain a complete domain name before starting a domain-name lookup.

Step 4

(Optional) Use the ip domain-list name [use-vrf vrf-name] command to define additional domain names that Cisco NX-OS can use to complete unqualified hostnames.

Example:

switch(config)# ip domain-list
mycompany.com

You can optionally define a VRF that Cisco NX-OS uses to resolve these domain names if they cannot be resolved in the VRF that you configured this domain name under.

Cisco NX-OS uses each entry in the domain list to append that domain name to any hostname that does not contain a complete domain name before starting a domain-name lookup. Cisco NX-OS continues this process for each entry in the domain list until it finds a match.

Step 5

(Optional) Use the ip name-server address1 [address2... address6] [source-interface interface-name] [use-vrf vrf-name] command to define up to six name servers.

Example:

switch(config)# ip name-server
192.0.2.22

The address can be either an IPv4 address or an IPv6 address.

You can optionally define a VRF or source interface that Cisco NX-OS uses to reach this name server if it cannot be reached in the VRF that you configured this name server under.

Note

 

Multiple DNS servers are for the case of unresponsive servers.

If the first DNS server in the list replies to the DNS query with a reject, the remaining DNS servers are not queried. If the first one doesn't respond, the next DNS server in list is queried.

Step 6

(Optional) Use the ip domain-lookup command to enable DNS-based address translation.

Example:

switch(config)# ip domain-lookup

This feature is enabled by default.

Step 7

(Optional) Use the show hosts command to see information about DNS.

Example:

switch(config)# show hosts

Step 8

(Optional) Use the copy running-config startup-config command to save this configuration change.

Example:

switch(config)# copy running-config
startup-config
					

Example

This example shows how to configure a default domain name and enable DNS lookup:

switch#<userinput> configure terminal</userinput>
				switch(config)# <userinput>ip domain-name cisco.com</userinput>
				switch(config)# <userinput>ip name-server 192.0.2.1 use-vrf management</userinput>
				switch(config)# <userinput>ip domain-lookup</userinput>
				switch(config)# <userinput>copy running-config startup-config</userinput>
			

Configure virtualization

You can configure a DNS client within a VRF. If you do not enter VRF configuration mode, your DNS client configuration applies to the default VRF.

You can optionally configure a DNS client to use a specified VRF other than the VRF under which you configured the DNS client as a backup VRF. For example, you can configure a DNS client in the Red VRF but use the Blue VRF to communicate with the DNS server if the server cannot be reached through the Red VRF.

Before you begin

Ensure that you have a domain name server on your network.

Procedure


Step 1

Use the vrf context vrf-name command to create a VRF and enters VRF configuration mode.

Example:

switch(config)# vrf context Red
						switch(config-vrf)#

Step 2

(Optional) Use the ip domain-name name [use-vrf vrf-name] command to define the default domain name server that Cisco NX-OS uses to complete unqualified hostnames.

Example:

switch(config-vrf)# ip domain-name
						myserver.com
You can optionally define a VRF that Cisco NX-OS uses to resolve this domain name server if it cannot be resolved in the VRF under which you configured this domain name.

Cisco NX-OS appends the default domain name to any hostname that does not contain a complete domain name before starting a domain-name lookup.

Step 3

(Optional) Use the ip domain-list name [use-vrf vrf-name] command to define additional domain name servers that Cisco NX-OS can use to complete unqualified hostnames.

Example:

switch(config-vrf)# ip domain-list
						mycompany.com

You can optionally define a VRF that Cisco NX-OS uses to resolve this domain name server if it cannot be resolved in the VRF under which you configured this domain name.

Cisco NX-OS uses each entry in the domain list to append that domain name to any hostname that does not contain a complete domain name before starting a domain-name lookup. Cisco NX-OS continues this process for each entry in the domain list until it finds a match.

Step 4

(Optional) Use the ip name-server address1 [address2... address6] [use-vrf vrf-name] command to define up to six name servers.

Example:

switch(config-vrf)# ip name-server
						192.0.2.22

The address can be either an IPv4 address or an IPv6 address.

You can optionally define a VRF that Cisco NX-OS uses to reach this name server if it cannot be reached in the VRF that you configured this name server under.

Note

 

Multiple DNS servers are for the case of unresponsive servers.

If the first DNS server in the list replies to the DNS query with a reject, the remaining DNS servers are not queried. If the first one doesn't respond, the next DNS server in list is queried.

Step 5

(Optional) use the show hosts command to see information about DNS.

Example:

switch(config-vrf)# show hosts

Step 6

(Optional) Use the copy running-config startup-config command to save this configuration change.

Example:

switch(config)# copy running-config
						startup-config
					

Example

This example shows how to configure a default domain and enable DNS lookup within a VRF:

switch# <userinput>configure terminal</userinput>
				switch(config)# <userinput>vrf context Red</userinput>
				switch(config-vrf)# <userinput>ip domain-name cisco.com</userinput>
				switch(config-vrf)# <userinput>ip name-server 192.0.2.1 use-vrf management</userinput>
				switch(config-vrf)# <userinput>copy running-config startup-config</userinput>
			

Verify DNS client configuration

To display the DNS client configuration, perform one of these tasks:

Command

Purpose

show hosts

Displays information about DNS.

Configuration examples for the DNS client

This example shows how to establish a domain list with several alternate domain names:

ip domain-list csi.com
			ip domain-list telecomprog.edu
			ip domain-list merit.edu 
			
		

This example shows how to configure the hostname-to-address mapping process and specify IP DNS-based translation. The example also shows how to configure the addresses of the name servers and the default domain name.

ip domain-lookup
			ip name-server 192.168.1.111 192.168.1.2
			ip domain-name cisco.com