- Table of Contents
-
- 06-Layer 3 - IP Services Command Reference
- 00-Preface
- 01-ARP Commands
- 02-IP Addressing Commands
- 03-DHCP Commands
- 04-DNS Commands
- 05-NAT Commands
- 06-IP Forwarding Basics Commands
- 07-Adjacency Table Commands
- 08-IP Performance Optimization Commands
- 09-UDP helper Commands
- 10-IPv6 Basics Commands
- 11-DHCPv6 Commands
- 12-IPv6 DNS Commands
- 13-Tunneling Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
04-DNS Commands | 87.64 KB |
display dns domain
Syntax
display dns domain [ dynamic ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
dynamic: Displays the domain name suffixes dynamically obtained through DHCP or other protocols.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use display dns domain to display the domain name suffixes.
Related commands: dns domain.
Examples
# Display domain name suffixes.
<Sysname> display dns domain
Type:
D:Dynamic S:Static
No. Type Domain-name
1 S com
Table 1 Command output
Field |
Description |
No |
Sequence number. |
Type |
Type of domain name suffix: · S—A statically configured domain name suffix. · D—A domain name suffix obtained dynamically through DHCP. |
Domain-name |
Domain name suffix. |
display dns host
Syntax
display dns host [ ip | ipv6 | naptr | srv ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
ip: Displays dynamic cache information about type A queries. A type A query resolves a domain name to the mapped IPv4 address.
ipv6: Displays dynamic cache information about type AAAA queries. A type AAAA query resolves a domain name to the mapped IPv6 address. For more information about IPv6 DNS configuration, see Layer 3—IP Services Configuration Guide.
naptr: Displays dynamic cache information about NAPTR queries. A NAPTR query offers the replacement rule of a character string to convert the character string to a domain name.
srv: Displays dynamic cache information about SRV queries. An SRV query offers the domain name of a certain service site.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use display dns host to display dynamic DNS cache information.
If you do not specify any keyword, this command displays dynamic DNS cache information about all query types.
Related commands: reset dns host.
Examples
# Display dynamic DNS cache information about all query types.
<Sysname> display dns host
No. Host TTL Type Reply Data
1 sample.com 3132 IP 192.168.10.1
2 sample.net 2925 IPv6 FE80::4904:4448
3 sip.sample.com 3122 NAPTR 100 10 u sip+E2U !^.*$!sip:info.se!i
4 website.tcp.sample.com 3029 SRV 10 10 8080 iis.sample.com
Table 2 Command output
Field |
Description |
No |
Sequence number. |
Host |
Domain name for query. |
TTL |
Time that a mapping can be stored in the cache, in seconds. |
Type |
Query type, IP, IPv6, NAPTR, and SRV. |
Reply Data |
Reply data concerning the query type: · For an IP query, the reply data is an IPv4 address. · For an IPv6 query, the reply data is an IPv6 address. · For a NAPTR query, the reply data comprises order, preference, flags, services, regular expression, and replacement. · For an SRV query, the reply data comprises the priority, weight, port, and target domain name. |
display dns server
Syntax
display dns server [ dynamic ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
dynamic: Displays DNS server information dynamically obtained through DHCP or other protocols.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use display dns server to display IPv4 DNS server information.
Related commands: dns server.
Examples
# Display IPv4 DNS server information.
<Sysname> display dns server
Type:
D:Dynamic S:Static
DNS Server Type IP Address
1 S 169.254.65.125
Table 3 Command output
Field |
Description |
DNS Server |
Sequence number of the DNS server, configured automatically by the switch, starting from 1. |
Type |
Type of domain name server: · S—A statically configured DNS server. · D—A DNS server obtained dynamically through DHCP. |
IP Address |
IPv4 address of the DNS server. |
display ip host
Syntax
display ip host [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use display ip host to display the host names and IPv4 addresses in the static domain name resolution table.
Examples
# Display the host names and IPv4 addresses in the static domain name resolution table.
<Sysname> display ip host
Host Age Flags Address
My 0 static 1.1.1.1
Aa 0 static 2.2.2.4
Table 4 Command output
Field |
Description |
Host |
Host name. |
Age |
Time to live. The value 0 means that the static mapping will never age out. You can only manually remove the static mappings between host names and IP addresses. |
Flags |
Indicates the mapping type. Static represents static domain name resolution. |
Address |
Host IPv4 address. |
dns domain
Syntax
dns domain domain-name
undo dns domain [ domain-name ]
View
System view
Default level
2: System level
Parameters
domain-name: Specifies a domain name suffix. It is a dot-separated case-insensitive string including letters, digits, hyphens (-), underscores (_), and dots (.) (for example, aabbcc.com). The domain name suffix can contain at most 238 characters, and each separated string contains no more than 63 characters.
Description
Use dns domain to configure a domain name suffix. The system can automatically add the suffix to part of the domain name you entered for resolution.
Use undo dns domain to delete a domain name suffix (with a domain name suffix specified) or all domain name suffixes (with no domain name suffix specified).
No domain name suffix is configured by default. Only the provided domain name is resolved.
The configured domain suffix is applicable to both IPv4 DNS and IPv6 DNS.
You can configure a maximum of 10 domain name suffixes.
Related commands: display dns domain.
Examples
# Configure com as a DNS suffix.
<Sysname> system-view
[Sysname] dns domain com
dns resolve
Syntax
dns resolve
undo dns resolve
View
System view
Default level
2: System level
Parameters
None
Description
Use dns resolve to enable dynamic domain name resolution.
Use undo dns resolve to disable dynamic domain name resolution.
Dynamic domain name resolution is disabled by default.
This command is applicable to both IPv4 DNS and IPv6 DNS.
Examples
# Enable dynamic domain name resolution.
<Sysname> system-view
[Sysname] dns resolve
dns server
Syntax
In system view:
dns server ip-address
undo dns server [ ip-address ]
In VLAN interface view:
dns server ip-address
undo dns server ip-address
View
System view, interface view
Default level
2: System level
Parameters
ip-address: IPv4 address of the DNS server.
Description
Use dns server to specify a DNS server.
Use undo dns server to remove DNS servers.
No DNS server is specified by default.
You can configure up to six DNS servers, including those with IPv6 addresses, in system view and on all interfaces of a switch.
The DNS server configured in system view has a higher priority than that configured in interface view. In a view, the DNS server configured earlier has a higher priority than that configured later. The DNS server manually configured has a higher priority than that obtained dynamically through DHCP.
Using the undo dns server command in system view will delete all DNS servers configured in system view and interface view. Using the undo dns server ip-address command in system view or interface view will delete the specified DNS server in system view or interface view.
Related commands: display dns server.
Examples
# Specify the DNS server 172.16.1.1 in system view.
<Sysname> system-view
[Sysname] dns server 172.16.1.1
ip host
Syntax
ip host hostname ip-address
undo ip host hostname [ ip-address ]
View
System view
Default level
2: System level
Parameters
hostname: Host name, consisting of 1 to 255 characters, including case-insensitive letters, numbers, hyphens (-), underlines (_), or dots (.). The host name must include at least one letter.
ip-address: IPv4 address of the specified host in dotted decimal notation.
Description
Use ip host to create a host name to IPv4 address mapping in the static resolution table.
Use undo ip host to remove a mapping.
No mappings are created by default.
You can configure only one mapping for a host name. A mapping newly configured for the host name will overwrite the previous one.
Related commands: display ip host.
Examples
# Map the IP address 10.110.0.1 to the host name aaa.
<Sysname> system-view
[Sysname] ip host aaa 10.110.0.1
reset dns host
Syntax
reset dns host [ ip | ipv6 | naptr | srv ]
View
User view
Default level
2: System level
Parameters
ip: Clears dynamic cache information about type A queries. A type A query resolves a domain name to the mapped IPv4 address.
ipv6: Clears dynamic cache information about type AAAA queries. A type AAAA query resolves a domain name to the mapped IPv6 address. For more information about IPv6 DNS configuration, see Layer 3—IP Services Configuration Guide.
naptr: Clears dynamic cache information about NAPTR queries. A NAPTR query offers the replacement rule of a character string to convert the character string to a domain name.
srv: Clears dynamic cache information about SRV queries. An SRV query offers the domain name of a certain service site.
Description
Use reset dns host to clear information about the dynamic DNS cache.
If you do not specify any keyword, this command displays dynamic DNS cache information about all query types.
Related commands: display dns host.
Examples
# Clear dynamic DNS cache information about all query types.
<Sysname> reset dns host