- Table of Contents
-
- 05-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 Performance Optimization Commands
- 07-Adjacency Table Commands
- 08-UDP Helper Commands
- 09-IPv6 Basics Commands
- 10-DHCPv6 Commands
- 11-IPv6 DNS Commands
- 12-NAT-PT Commands
- 13-Tunneling Commands
- 14-GRE Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
04-DNS Commands | 90.38 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.
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 router, 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 |
IP address of the IPv4 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 corresponding IPv4 addresses in the static domain name resolution table.
Examples
# Display the host names and corresponding 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. 0 means that the static mapping will never age out. You can only manually remove the mappings between host names and IPv4 addresses. |
Flags |
Indicates the mapping type, static or dynamic. Static represents static IPv4 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, and only the provided domain name is resolved.
The domain name suffix configured with the dns domain command 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 proxy enable
Syntax
dns proxy enable
undo dns proxy enable
View
System view
Default level
2: System level
Parameters
None
Description
Use the dns proxy enable command to enable DNS proxy.
Use the undo dns proxy enable command to disable DNS proxy.
By default, DNS proxy is disabled.
Examples
# Enable DNS proxy.
<Sysname> system-view
[Sysname] dns proxy enable
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
dns server
Syntax
In system view:
dns server ip-address
undo dns server [ ip-address ]
In 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 upt to six DNS servers on all the interfaces of the router.
· A DNS server configured in system view has a higher priority than one configured in interface view. A DNS server configured earlier has a higher priority than one configured later in the same view. A DNS server manually configured has a higher priority than one dynamically obtained through DHCP.
· Running the undo dns server command in system view will delete all DNS servers configured in system view and interface view. Running the undo dns server ip-address command in system view or interface view will delete the specific 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
dns spoofing
Syntax
dns spoofing ip-address
undo dns spoofing
View
System view
Default level
2: System level
Parameters
ip-address: IP address used to spoof name query requests.
Description
Use the dns spoofing command to enable DNS spoofing.
Use the undo dns spoofing command to disable DNS spoofing.
By default, DNS spoofing is disabled.
With DNS proxy enabled but no DNS server specified or no DNS server reachable, a router cannot forward a DNS request, or answer the request. In this case, you can enable DNS spoofing on the router to spoof a reply with the configured IP address. Once a DNS server is reachable, the router will send DNS requests to the server and return replies to the requesting DNS clients.
If you repeatedly execute the dns spoofing command with different IP addresses specified, the latest configuration will overwrite the previous one.
Examples
# Enable DNS spoofing and specify the IP address as 1.1.1.1
<Sysname> system-view
[Sysname] dns spoofing 1.1.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 (-), underscore (_), 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.
Each host name can correspond to only one IPv4 address. The IPv4 address you last assign to the host name will overwrite the previous one if there is any.
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.
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 command clears the dynamic DNS cache information of all query types.
Related commands: display dns host.
Examples
# Clear the dynamic DNS cache information of all query types.
<Sysname> reset dns host