- 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 | 88.13 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 the display dns domain command 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 Output description
Field |
Description |
No |
Sequence number |
Type |
Type of domain name suffix: S represents a statically configured domain name suffix, and D represents 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 the dynamic cache information of type A queries. A type A query resolves a domain name to the mapped IPv4 address.
ipv6: Displays the dynamic cache information of 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 the dynamic cache information of NAPTR queries. A NAPTR query offers the replacement rule of a character string to convert the character string to a domain name.
srv: Displays the dynamic cache information of 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 the display dns host command to display the dynamic DNS cache information.
Without any keyword specified, the dynamic DNS cache information of all query types will be displayed.
Related commands: reset dns host.
Examples
# Display the dynamic DNS cache information of 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 Output description
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, including 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 the 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 the display dns server command to display the IPv4 DNS server information.
Related commands: dns server.
Examples
# Display the 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 Output description
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 represents a statically configured DNS server, and D represents 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 the display ip host command 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 Output description
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: Domain name suffix, consisting of character strings separated by a dot (for example, aabbcc.com). Each separated string contains no more than 63 characters. A domain name suffix may include case-insensitive letters, digits, hyphens (-), underscores (_), and dots (.), with a total length of 238 characters.
Description
Use the dns domain command to configure a domain name suffix. The system can automatically add the suffix to part of the domain name you entered for resolution.
Use the undo dns domain command 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.
Note the following:
· 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 the dns resolve command to enable dynamic domain name resolution.
Use the undo dns resolve command 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 the dns server command to specify a DNS server.
Use the undo dns server to remove DNS server(s).
No DNS server is specified by default.
Note the following:
· 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 higher priority than that configured later. The DNS server manually configured has 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 the ip host command to create a host name to IPv4 address mapping in the static resolution table.
Use the undo ip host command 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 the dynamic cache information of type A queries. A type A query resolves a domain name to the mapped IPv4 address.
ipv6: Clears the dynamic cache information of 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 the dynamic cache information of NAPTR queries. A NAPTR query offers the replacement rule of a character string to convert the character string to a domain name.
srv: Clears the dynamic cache information of SRV queries. An SRV query offers the domain name of a certain service site.
Description
Use the reset dns host command to clear information of the dynamic DNS cache.
Without any keyword specified, the dynamic DNS cache information of all query types will be cleared.
Related commands: display dns host.
Examples
# Clear the dynamic DNS cache information of all query types.
<Sysname> reset dns host