Domain Name Server Client Commands

Use these M4500 CLI commands to configure the DNS client, including static host entries, domain names, name servers, source interface, retries, and timeouts.

show hosts

This command displays the static host name-to-address mapping table.

Default None
Format show hosts [<hostname>]
Mode Privileged Exec

Display Message

Parameter Definition
DNS Client Source Interface The source interface of the DNS client.
Host Name Domain host name.
Default Domain Default domain name.
Default Domain List Default domain list.
Domain Name Lookup DNS client enabled/disabled.
Number of Retries Number of time to retry sending DNS queries.
Retry Timeout Period Amount of time to wait for a response to a DNS query.
Name Servers Configured name servers.

Example: The following shows examples of the CLI display output for the commands.

CODE
(M4500-48XF8C) #show hosts
Host name...................................... M4500-48XF8C
Default domain................................. Domain name is not configured
Default domain list............................ Domain Name List is not configured
Domain Name Lookup............................. Enabled
Number of retries.............................. 2
Retry timeout period........................... 3
Name servers (Preference order)................ 10.1.1.7, 10.1.1.6
Dns Client Source Interface.................... (not configured)

Configured host name-to-address mapping:

 Host                                Addresses
------------------------ ----------------------
No host name is configured to IP address

 Host                   Total   Elapsed    Type        Addresses
---------------------- -------  -------    ----        --------------
No hostname is mapped to an IP address

ip host

This command creates a static entry in the DNS table that maps a host name to an IP address.

Default None
Format ip host <name> <ipaddr>
Mode Global Config
Parameter Definition
<name> Host name.
<ipaddr> IPv4 address of the host.

no ip host

Remove the corresponding name to IP address mapping entry.

Format no ip host <name>
Mode Global Config

clear host

This command clears the entire static host name-to-address mapping table.

Default None
Format clear host <hostname | all>
Mode Privileged Exec

ip domain-name

This command defines the default domain name to be appended to incomplete host names (i.e., host names passed from a client are not formatted with dotted notation).

Default None
Format ip domain-name <name>
Mode Global Config
Parameter Definition
<name> Default domain name used to complete unqualified host names. Do not include the initial period that separates an unqualified name from the domain name. (Range: 1-64 characters)

no ip domain-name

This command removes the default domain name.

Format no ip domain-name
Mode Global Config

ip domain-list

This command defines the domain list of default domain names to complete unqualified names.

Default None
Format ip domain-list <name>
Mode Global Config
Parameter Definition
<name> Domain list indicates list of default domain names to complete unqualified names.

no ip domain-list

This command removes the default domain list.

Format no ip domain-list <name>
Mode Global Config

ip name-server

This command specifies the address of one or more domain name servers to use for name-to-address resolution.

Note: The listed name servers are queried in the specified sequence until a response is received, or the end of the list is reached with no response.
Default None
Format ip name-server <ipaddr>
Mode Global Config
Parameter Definition
<ipaddr> IP address of the Domain Name Servers.

no ip name-server

Remove the corresponding Domain Name Server entry from the table.

Format no ip name-server [<ipaddr>]
Mode Global Config

ip name-server source-interface

This command specifies the source address of dns client to use for name-to-address resolution.

Default None
Format ip name-server source-interface {<slot/port> | loopback <loopback-id> | serviceport | tunnel <tunnel-id> | vlan <vlan-id>}
Mode Global Config
Parameter Definition
<slot/port> Specifies the interface to use as the source interface.
<loopback-id> Specifies the loopback interface to use as the source interface. The range of the loopback ID is 0 to 63.
serviceport Specifies the serviceport interface to use as the source interface.
<tunnel-id> Specifies the tunnel interface to use as the source interface. The range of the tunnel ID is 0 to 7.
<vlan-id> Specifies the VLAN interface to use as the source interface. The range of the VLAN ID is 1 to 4093.

no ip name-server source-interface

This command will reset the DNS source interface to the default settings.

Format no ip name-server source-interface
Mode Global Config

ip domain-lookup

This command enables the IP Domain Naming System (DNS)-based host name-to-address translation.

Default None
Format ip domain-lookup
Mode Global Config

no ip domain-lookup

This command disables the IP Domain Naming System (DNS)-based host name-to-address translation.

Format no ip domain-lookup
Mode Global Config

ip domain-retry

This command specifies the number of times to retry sending Domain Name System (DNS) queries.

Default 2
Format ip domain-retry <0-100>
Mode Global Config
Parameter Definition
<0-100> The number of times to retry sending a DNS query to the server.

no ip domain-retry

This command will reset the number of retry times to the default settings.

Format no ip domain-retry
Mode Global Config

ip domain-retry-timeout

This command specifies the amount of time to wait for a response to a DNS query.

Default 3
Format ip domain-retry-timeout <0-3600>
Mode Global Config

no ip domain-retry-timeout

This command will reset the timeout to the default setting.

Format no ip domain-retry-timeout
Mode Global Config

ipv6 host

This command creates a static entry in the DNS table that maps a host name to an IPv6 address.

Default None
Format ipv6 host <name> <ipv6-address>
Mode Global Config
Parameter Definition
<name> Host name.
<ipv6-address> IPv6 address of the host.

no ipv6 host

This command removes the corresponding host name from an IPv6 address mapping entry.

Format no ipv6 host <name>
Mode Global Config