No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Command Reference

CloudEngine 8800, 7800, 6800, and 5800 V200R002C50

This document describes all the configuration commands of the device, including the command function, syntax, parameters, views, default level, usage guidelines, examples, and related commands.
Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
DNS Configuration Commands

DNS Configuration Commands

NOTE:

The CE6810LI does not support IPv4 Layer 3 forwarding. After the IPv4 function is enabled on an interface of the CE6810LI, the configured IPv4 address can only be used to manage the switch.

display dns dynamic-host

Function

The display dns dynamic-host command displays information about dynamic DNS entries in the domain name cache.

Format

display dns dynamic-host [ vpn-instance vpn-name ]

Parameters

Parameter Description Value
vpn-name

Specifies the VPN to be displayed.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

After configuring dynamic DNS, you can run the display dns dynamic-host command to view information about dynamic DNS entries stored in the domain name cache.

Example

# Display information about dynamic DNS entries.

<HUAWEI> display dns dynamic-host
No  Domain Name         IpAddress      TTL    Alias
1   www.huawei.com      10.1.1.1       3521
2   www.huawei.com.cn   10.2.1.1       3000
Table 8-27  Description of the display dns dynamic-host command output

Item

Description

No

Number of a dynamic entry.

Domain Name

Host name.

IpAddress

Host IP address.

TTL

Time to live of a DNS entry, in seconds.

Alias

Host alias.

display dns domain

Function

The display dns domain command displays domain name suffixes.

Format

display dns domain [ vpn-instance vpn-name ]

Parameters

Parameter Description Value
vpn-name

Specifies the VPN to be displayed.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

After configuring DNS domain name suffixes, you can run the display dns domain command to view whether the configuration is successful.

Example

# Display configured domain name suffixes.

<HUAWEI> display dns domain
No                    Domain Name
 1                    com
 2                    net
Table 8-28  Description of the display dns domain command output

Item

Description

No

Configuration sequence of a domain name suffix.

Domain Name

Configured domain name suffix. The domain name suffix is configured using the dns domain command.

display dns statistics packet

Function

The display dns statistics packet command displays statistics about DNS packets sent and received.

Format

display dns statistics packet

Parameters

None

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

To check statistics about DNS packets sent and received during domain name queries when the CE8800, CE7800, CE6800, and CE5800 series switches functions as a DNS client, run the display dns statistics packet command.

Before collecting statistics about DNS packets sent and received, run the reset dns statistics packet command to clear existing statistics. Then you can run the display dns statistics packet command to check the statistics in a specified period.

Example

# Display statistics about DNS packets sent and received.

<HUAWEI> display dns statistics packet
--------------------------------------------------------------------------
Received:
  Total packets         : 1         
    Discarded packets     : 0         
  RR types:
    A                     : 1           AAAA                  : 0         
    CNAME                 : 0           PTR                   : 0         
    Unsupport             : 0         

Sent:
  Total packets         : 1         
    Standard              : 1           Inverse               : -         
  Question types:
    A                     : 1           AAAA                  : 0         
    PTR                   : 0         
--------------------------------------------------------------------------
Table 8-29  Description of the display dns statistics packet command output

Item

Description

Received

Statistics about received DNS packets.

Total packets

Total number of received DNS packets.

Discarded packets

Number of discarded DNS packets, among the ones received. If the system cannot generate dynamic entries for some received DNS packets, it discards these packets and counts them as discarded packets. The system can generate dynamic entries as long as the received DNS packets have options.

RR types

Statistics about received DNS packets with specific resource record (RR) types.

  • Discarded DNS packets that carry RR types are not counted.
  • If the RR types carried in DNS packets that are received and not discarded can be identified, they are counted by specific types. If these RR types cannot be identified, they are counted in the Unsupport field.

A

Number of received DNS packets carrying an A RR. An A RR records an IPv4 address obtained based on a domain name.

AAAA

Number of received DNS packets carrying an AAAA RR. An AAAA RR records an IPv6 address obtained based on a domain name.

CNAME

Number of received DNS packets carrying a CNAME RR. A CNAME RR records an alias obtained based on a domain name.

PTR

Number of received DNS packets carrying a PTR RR. A PTR RR records a domain name obtained based on an IPv4/IPv6 address.

Unsupport

Number of received DNS packets carrying an unidentifiable RR.

Sent

Statistics about sent DNS packets.

Total packets

Total number of sent DNS packets.

Standard

Number of sent DNS packets of the Standard type.

Inverse

Number of sent DNS packets of the Inverse type.

Question types

Statistics about sent DNS packets with specific query types.

A

Number of sent DNS packets carrying an A query. An A query asks for an IPv4 address based on a domain name.

AAAA

Number of sent DNS packets carrying an AAAA query. An AAAA query asks for an IPv6 address based on a domain name.

PTR

Number of sent DNS packets carrying a PTR query. A PTR query asks for an IPv4/IPv6 address based on a domain name. Statistics items displayed as two hyphens (--) are not supported.

display dns server

Function

The display dns server command displays the IP addresses of DNS servers.

Format

display dns server [ vpn-instance vpn-name ]

Parameters

Parameter Description Value
vpn-name

Specifies the VPN to be displayed.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

After configuring the IP addresses of DNS servers, you can run the display dns server command to check whether the configuration is successful.

Example

# Display the IP addresses configured for DNS servers.

<HUAWEI> display dns server
IPv4 Dns Servers :
Domain-server        IpAddress
            1        172.16.1.1
            2        172.16.1.2
IPv6 Dns Servers :
Domain-server Ipv6Address            Interface Name
     1        2001:db8::1
     2        2001:db8::2
Table 8-30  Description of the display dns server command output

Item

Description

IPv4 Dns Servers

IPv4 DNS server.

Domain-server

Configuration sequence of a DNS server.

IpAddress

IP address of a DNS server. In domain name resolution, DNS servers are queried in sequence.

IPv6 Dns Servers

Indicates the configuration of the IPv6 DNS server.

Ipv6Address

IPv6 address of the domain name server

Interface Name

Interface name (only for IPv6 link local address)

display ip host

Function

The display ip host command displays the mappings between host names and IP addresses.

Format

display ip host [ vpn-instance vpn-name ]

Parameters

Parameter Description Value
vpn-name

Specifies the VPN to be displayed.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

After configuring static DNS entries, you can run the display ip host command to view the mappings between host names and IP addresses.

Example

# Display the mappings between host names and IP addresses.

<HUAWEI> display ip host
Host          Age       Flags           Address
hw              0       static          10.1.1.1
gww             0       static          192.168.1.1

# Display the mappings between the domain names and IP addresses in the VPN named vpn1.

<HUAWEI> display ip host vpn-instance vpn1
Host          Age       Flags           Address
hw              0       static          10.1.1.1
gww             0       static          192.168.1.1
Table 8-31  Description of the display ip host command output

Item

Description

Host

Host name.

Age

Aging time of a DNS entry. The value is 0 for static DNS entries, indicating that static DNS entries do not age.

Flags

Flag of a DNS entry. The value is Static for static DNS entries.

Address

IP address corresponding to a host name.

Related Topics

dns domain

Function

The dns domain command adds a domain name suffix.

The undo dns domain command deletes a domain name suffix.

By default, domain names do not have suffixes.

Format

dns domain domain-name [ vpn-instance vpn-name ]

undo dns domain [ domain-name ] [ vpn-instance vpn-name ]

Parameters

Parameter Description Value
domain-name Specifies a domain name. The value is a string of 1 to

63

case-sensitive characters, spaces not supported. The string can contain letters, digits, underscores (_), and dots (.).
vpn-name

Specifies the name of a VPN instance.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The suffixes for frequently used domain names are usually the same. For example, many websites use "com" as their domain name suffixes. After you define "com" as the domain name suffix for a website, you need to enter only the domain name when performing a ping operation on the website. The DNS Client automatically adds suffix "com" to the domain name before resolving the domain name. If the corresponding IP address is not found, the DNS server then resolves the domain name. For example, after you enter "google", the DNS Client resolves "google.com" first. If the corresponding IP address is not found, the DNS Client then resolves "google".

Precautions

If domain-name is specified in the undo dns domain command, only the specified suffix is deleted; if domain-name is not specified in the undo dns domain command, all suffixes are deleted.

Example

# Add suffix com.cn to a domain name.

<HUAWEI> system-view
[~HUAWEI] dns domain com.cn

dns resolve

Function

The dns resolve command enables dynamic DNS.

The undo dns resolve command disables dynamic DNS.

By default, dynamic DNS is disabled.

Format

dns resolve

undo dns resolve

Parameters

None

Views

System view

Default Level

2: Configuration level

Usage Guidelines

If you want to obtain the IP addresses of destination hosts through their host names (for example, when you perform the ping or tracert operation), you can use dynamic DNS. The dns resolve command allows you to enable dynamic DNS.

Using dynamic DNS for domain name resolution takes a long time. Sometimes, you may want to use static DNS instead. In this case, you can run the undo dns resolve command to disable dynamic DNS.

Example

# Enable dynamic DNS.

<HUAWEI> system-view
[~HUAWEI] dns resolve

dns server

Function

The dns server command configures an IP address for a DNS server.

The undo dns server command deletes the IP address of a DNS server.

By default, DNS servers do not have IP addresses.

Format

dns server ip-address [ vpn-instance vpn-name ]

undo dns server ip-address [ vpn-instance vpn-name ]

Parameters

Parameter Description Value
ip-address IP address of a DNS server. The value is in dotted decimal notation.
vpn-instance vpn-name

Specifies the VPN to be displayed.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If you want to obtain the IP addresses of destination hosts through their host names (for example, when you perform the ping or tracert operation), you need to run the dns resolve command to enable dynamic DNS. After dynamic DNS is enabled, you must run the dns server command to specify the IP addresses of the DNS servers, so as to obtain the mappings between the domain names and IP addresses of destination hosts.

Precautions

When using the dns server command, note the following:
  • In dynamic DNS, the DNS client sends query packets to DNS servers in the configuration sequence of DNS servers. If a DNS client does not receive any response within 5 seconds after sending a DNS request, the DNS client re-sends the DNS request. If the DNS client does not receive any response for three consecutive attempts, the DNS client sends the DNS request to the next DNS server.
  • The IP addresses of DNS servers cannot be multicast addresses.

Example

# Set the IP address of a DNS server to 172.16.1.1.

<HUAWEI> system-view
[~HUAWEI] dns server 172.16.1.1

# Set the IP address of the DNS server in the VPN named vpn1 to 172.16.1.2.

<HUAWEI> system-view
[~HUAWEI] dns server 172.16.1.2 vpn-instance vpn1

dns server source-ip

Function

The dns server source-ip command specifies an IP address of the DNS client as the source address for DNS communication.

The undo dns server source-ip command deletes the source address configured for DNS communication.

By default, no IP address is specified as the source address for DNS communication.

Format

dns server source-ip [ vpn-instance vpn-name ] ip-address

undo dns server source-ip [ vpn-instance vpn-name ] [ ip-address ]

Parameters

Parameter Description Value
ip-address Specifies an IP address of the DNS client as the source address for DNS communication. The value is in dotted decimal notation.
vpn-instance vpn-name

Specifies the VPN to be displayed.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If dynamic DNS is configured, you can run the dns server source-ip command to specify an IP address of the DNS client as the source address for DNS communication. This configuration ensures communication security. After an IP address of the DNS client is configured as the source address, the DNS server returns resolution results directly to that IP address. If you do not specify the source address, the source address carried in the DNS request varies according to the destination address.

Prerequisites

Before the dns server source-ip command is run, perform the following operations:
  1. In the system view, run the dns resolve command to enable dynamic DNS.

  2. In the system view, run the dns server command to configure a DNS server address.

Follow-up Procedure

After the dns server source-ip command is run, perform the following operations to implement dynamic DNS:
  • Run the dns domain command to configure the domain name suffix.

Example

# Specify the IP address of the DNS client 10.110.2.1 as the source address for DNS communication.

<HUAWEI> system-view
[~HUAWEI] dns server source-ip 10.110.2.1

# Specify the IP address of the local router in vpn1 to 10.110.2.1.

<HUAWEI> system-view
[~HUAWEI] dns server source-ip 10.110.2.1

dns timeout

Function

The dns timeout command configures a DNS query response timeout period on a DNS client.

The undo dns timeout command restores the default DNS query response timeout period on a DNS client.

By default, the DNS query response timeout period on a DNS client is 5s.

Format

dns timeout interval-time

undo dns timeout [ interval-time ]

Parameters

Parameter Description Value
interval-time Specifies a DNS query response timeout period, expressed in seconds.

The value is an integer ranging from 1 to 10.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

After a DNS client sends a DNS query request to a DNS server, it initializes the retransmission count and starts the DNS query response timer. If the timer expires, the retransmission count increases by 1. When the retransmission count exceeds the specified value, the client stops sending packets to this DNS server and starts sending query request packets to a next DNS server. To adjust the DNS query response timeout period based on network conditions, run the dns timeout command. You can run the dns try command to configure the retransmission times for DNS query packets.

Example

# Set the DNS query response timeout period to 6s.

<HUAWEI> system-view
[~HUAWEI] dns timeout 6
Related Topics

dns try

Function

The dns try command configures the number of retransmission times for DNS query packets on a DNS client.

The undo dns try command restores the default number of retransmission times for DNS query packets on a DNS client.

By default, a DNS client can retransmit DNS query packets twice.

Format

dns try times

undo dns try [ times ]

Parameters

Parameter Description Value
times Specifies the number of retransmission times for DNS query packets on a DNS client.

The value is an integer ranging from 1 to 3.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

After a DNS client sends a DNS query request to a DNS server, it initializes the retransmission count and starts the DNS query response timer. If the timer expires, the retransmission count increases by 1. When the retransmission count exceeds the specified value, the client stops sending packets to this DNS server and starts sending query request packets to a next DNS server. To configure the number of retransmission times for DNS query packets, run the dns try command. You can run the dns timeout command to configure the DNS query response timer.

Example

# Set the number of retransmission times for DNS query packets on a DNS client to 3.

<HUAWEI> system-view
[~HUAWEI] dns try 3
Related Topics

ip host

Function

The ip host command configures the mappings between host names and IP addresses.

The undo ip host command deletes the mappings between host names and IP addresses.

By default, host names and IP addresses do not have mapping relationships.

Format

ip host host-name ip-address [ vpn-instance vpn-name ]

undo ip host host-name [ ip-address ] [ vpn-instance vpn-name ]

Parameters

Parameter Description Value
host-name Specifies a host name. The value is a string of 1 to 255 case-insensitive characters.
ip-address Specifies an IP address corresponding to a host name. The value is in dotted decimal notation.
vpn-name

Specifies the name of a VPN instance.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If you want to use static DNS for domain name resolution, you must run the ip host command to configure the mappings between host names and IP addresses first.

Precautions

When using the ip host command, note the following:
  • A VS allows you to configure a maximum of 1024 static DNS entries using the ip host command.
  • Each host name corresponds to only one IP address. If multiple IP addresses are assigned to a host, the latest configured IP address overrides the previous ones.

Example

# Set the IP address corresponding to host name huawei to 10.110.0.1.

<HUAWEI> system-view
[~HUAWEI] ip host huawei 10.110.0.1

# Set the IP address corresponding to host name RTA in the VPN named vpn1 to 10.110.0.2.

<HUAWEI> system-view
[~HUAWEI] ip host RTA 10.110.0.2 vpn-instance vpn1
Related Topics

reset dns dynamic-host

Function

The reset dns dynamic-host command clears information about dynamic DNS entries in the domain name cache.

Format

reset dns dynamic-host [ vpn-instance vpn-name ]

Parameters

Parameter Description Value
vpn-name

Specifies the VPN to be displayed.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string.

Views

User views

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If the number of dynamic DNS entries in the domain name cache exceeds the maximum number allowed by the cache, a large amount of redundant data is generated. In this case, you can run the reset dns dynamic-host command to clear dynamic DNS entries stored in the domain name cache.

Precautions

The dynamic DNS entries cannot be restored after being cleared. Confirm the action before you use the command.

Example

# Clear dynamic DNS entries stored in the domain name cache.

<HUAWEI> reset dns dynamic-host

reset dns statistics packet

Function

The reset dns statistics packet command clears statistics about DNS packets sent and received.

Format

reset dns statistics packet

Parameters

None

Views

User view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

To clear statistics about DNS packets sent and received, run the reset dns statistics packet command. Before collecting statistics about DNS packets sent and received, run the reset dns statistics packet command to clear existing statistics. Then you can run the display dns statistics packet command to check statistics in a specified period.

Configuration Impact

Running the reset dns statistics packet command clears statistics about all DNS packets. Exercise caution when running the command.

Example

# Clear statistics about DNS packets sent and received.

<HUAWEI> reset dns statistics packet
Translation
Download
Updated: 2019-03-21

Document ID: EDOC1000166501

Views: 52528

Downloads: 339

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next