4.5. DNS Commands

4.5.1. ip host

Command Purpose

To define static hostname-to-address mappings in the Domain Name System (DNS) hostname cache for a DNS view, use the ip host command in global configuration mode. If the hostname cache does not exist yet, it is automatically created.

To remove a hostname-to-address mapping, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

ip host HOSTNAME IP_ADDR

no ip host hostname

Parameter

Parameter Description

Parameter Value

HOSTNAME

Name of the host

String with up to 63 characters

IP_ADDR

Associated host IP address

IPv4 Address

Command Mode

Global Config

Default

No static hostname-to-address mapping is added to the DNS hostname cache for a DNS view.

Usage

None

Examples

The following example shows how to add a mapping entry to the global hostname cache and then remove one of those entries from the global hostname cache:

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

4.5.2. dns domain

Command Purpose

To specify the default domain for a Domain Name System (DNS) view to use to complete unqualified hostnames (names without a dotted-decimal domain name), use the dns domain command in Global Config mode.

To remove the specification of the default domain name for a DNS view, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dns domain DOMAIN-NAME

no dns domain DOMAIN-NAME

Parameter

Parameter Description

Parameter Value

DOMAIN-NAME

Name of the domain

String with up to 63 characters

Command Mode

Global Config

Default

No default domain name is defined for the DNS view.

Usage

None

Examples

The following example shows how to specify the default domain for DNS:

Switch# configure terminal
Switch(config)# dns domain www.example1.com

Related Commands

show dns domain

4.5.3. dns server

Command Purpose

To add a name server to the list of Domain Name System (DNS) name servers, use the dns server command in Global Config mode. To remove a DNS name server from the list, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

dns server IP_ADDR ( source-interface IFNAME | source-ip A.B.C.D | )

no dns server IP_ADDR

Parameter

Parameter Description

Parameter Value

IP_ADDR

IP address of a DNS name server

Support IPv4/IPv6 Address

IFNAME

Name of source interface

Supportphysical/aggregation/loopback/tunnel/vlanports

A.B.C.D

Source IP address

IPv4 Address

Command Mode

Global Config

Default

No IP address is explicitly added to the list of resolving name servers for this view.

Usage

This command can be entered multiple times to specify a maximum of three resolving name servers. After three resolving name servers have been specified, additional resolving name servers cannot be specified unless an existing entry is removed.

If the source interface or source IP address is specified, the packet transmit will use the related IP address as source address.

Examples

The following example shows how to specify the DNS server list:

Switch# configure terminal
Switch(config)# dns server 10.10.1.1
Switch(config)# dns server 20.20.2.2

Related Commands

show dns server

4.5.4. show dns

Command Purpose

To display configuration information about a Domain Name System (DNS) view, use the show dns command in privileged EXEC mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show dns { domain | server }

Parameter

Parameter Description

Parameter Value

domain

Display DNS domain list

-

server

Display DNS server list

-

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

The following is sample output from the show dns domain command:

Switch# show dns domain

Current DNS domain configuration:
Domain Suffix
------------------------------------------------
1 domain domain.com
2 domain aa.com

Related Commands

dns server

dns domain

4.5.5. show ip host

Command Purpose

To display configuration information about an ip host view, use the show ip host command in privileged EXEC mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show ip host

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

The following is sample output from the show ip host command:

Switch# show ip host

Current IP host configuration:
Host Address
-----------------------------------------------
1 www.sampledomain.com 1.1.1.1

Related Commands

ip host