- Table of Contents
-
- 04-Layer 3 Command Reference
- 00-Preface
- 01-ARP Commands
- 02-IP Addressing Commands
- 03-DHCP Commands
- 04-DHCPv6 Commands
- 05-DNS Commands
- 06-IPv6 DNS Commands
- 07-NAT Commands
- 08-Adjacency Table Commands
- 09-Flow Classification Commands
- 10-IPv6 Basics Commands
- 11-IP Performance Optimization Commands
- 12-Basic IP Routing Commands
- 13-Static Routing Commands
- 14-IPv6 Static Routing Commands
- 15-GRE Commands
- 16-RIP Commands
- 17-RIPng Commands
- 18-Policy-Based Routing Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
05-DNS Commands | 84.19 KB |
IPv4 DNS configuration commands
display dns domain
Use display dns domain to display the domain name suffixes.
Syntax
display dns domain [ dynamic ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command 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.
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. |
dns domain
display dns host
Use display dns host to display dynamic DNS cache information.
Syntax
display dns host [ ip | ipv6 ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command 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, see Layer 3 Configuration Guide.
|: 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.
Usage guidelines
If you do not specify any parameter, this command displays dynamic DNS cache information about all query types.
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
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 or IPv6. |
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. |
reset dns host
display dns server
Use display dns server to display IPv4 DNS server information.
Syntax
display dns server [ dynamic ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command 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.
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 device, starting from 1. |
Type |
Type of domain name server: · S—A manually configured DNS server. · D—A DNS server obtained dynamically through DHCP. |
IP Address |
IPv4 address of the DNS server. |
dns server
display ip host
Use display ip host to display the host names and corresponding IPv4 addresses in the static domain name resolution table.
Syntax
display ip host [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command 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.
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 Command output
Field |
Description |
Host |
Host name. |
Age |
Time to live. The value of 0 means that the static mapping never ages out. You can only manually remove the static mappings between host names and IPv4 addresses. |
Flags |
Mapping type. Static represents static IPv4 domain name resolution. |
Address |
Host IPv4 address. |
dns domain
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).
Syntax
dns domain domain-name
undo dns domain [ domain-name ]
Default
No domain name suffix is configured. Only the provided domain name is resolved.
Views
System view
Default command level
2: System level
Parameters
domain-name: Specifies the 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 can include case-insensitive letters, digits, hyphens (-), underscores (_), and dots (.), with a total length of 238 characters.
Usage guidelines
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.
Examples
# Configure com as a DNS suffix.
<Sysname> system-view
[Sysname] dns domain com
display dns domain
dns proxy enable
Use dns proxy enable to enable DNS proxy.
Use undo dns proxy enable to disable DNS proxy.
Syntax
dns proxy enable
undo dns proxy enable
Default
DNS proxy is disabled.
Views
System view
Default command level
2: System level
Examples
# Enable DNS proxy.
<Sysname> system-view
[Sysname] dns proxy enable
dns resolve
Use dns resolve to enable dynamic domain name resolution.
Use undo dns resolve to disable dynamic domain name resolution.
Syntax
dns resolve
undo dns resolve
Default
Dynamic domain name resolution is disabled.
Views
System view
Default command level
2: System level
Usage guidelines
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
Use dns server to specify a DNS server.
Use undo dns server to remove DNS servers.
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
Default
No DNS server is specified.
Views
System view, interface view
Default command level
2: System level
Parameters
ip-address: Specifies the IPv4 address of the DNS server.
Usage guidelines
You can configure up to six DNS servers in system view, including those with IPv6 addresses, and up to six DNS servers on all interfaces of a device.
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 deletes all DNS servers configured in system view and interface view. Running the undo dns server ip-address command in system view or interface view deletes the specified DNS server in system view or interface view.
Examples
# Specify the DNS server 172.16.1.1 in system view.
<Sysname> system-view
[Sysname] dns server 172.16.1.1
display dns server
dns source-interface
Use dns source-interface to specify the source interface for DNS packets.
Use undo dns source-interface to restore the default.
Syntax
dns source-interface interface-type interface-number
undo dns source-interface
Default
No source interface for DNS packets is specified. The device uses the primary IP address of the output interface of the matching route as the source IP address of a DNS request.
Views
System view
Default command level
2. System level
Parameters
interface-type interface-number: Specifies the interface type and number.
Usage guidelines
The device uses the primary IP address of the specified source interface as the source IP address of a DNS request, which is still forwarded through the output interface of the matching route.
Examples
# Specify VLAN-interface 2 as the source interface of DNS requests.
<Sysname> system-view
[Sysname] dns source-interface vlan-interface2
ip host
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.
Syntax
ip host hostname ip-address
undo ip host hostname [ ip-address ]
Default
No mappings are created.
Views
System view
Default command level
2: System level
Parameters
hostname: Specifies the host name, consisting of 1 to 255 characters, including case-insensitive letters, numbers, hyphens (-), underscores (_), or dots (.). The host name must include at least one letter.
ip-address: Specifies the IPv4 address of the specified host in dotted decimal notation.
Usage guidelines
Each host name can correspond to only one IPv4 address. If you use the command multiple times, the most recent configuration takes effect.
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
display ip host
reset dns host
Use reset dns host to clear information about the dynamic DNS cache.
Syntax
reset dns host [ ip | ipv6 ]
Views
User view
Default command 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, see Layer 3 Configuration Guide.
Usage guidelines
If you do not specify any parameter, this command clears dynamic DNS cache information about all query types.
Examples
# Clear dynamic DNS cache information about all query types.
<Sysname> reset dns host
Related commands
display dns host
DDNS configuration commands
Support for this feature depends on the device model. For more information, see About the H3C Access Controllers Command references.
ddns apply policy
Use ddns apply policy to apply the specified DDNS policy to the interface, update the mapping between the specified FQDN and the primary IP address of the interface, and enable DDNS update.
Use undo ddns apply policy to remove the DDNS policy application and stop DDNS update.
Syntax
ddns apply policy policy-name [ fqdn domain-name ]
undo ddns apply policy policy-name
Default
No DDNS policy is applied to any interface, no mapping between the FQDN and the primary IP address is specified for update, and DDNS update is disabled.
Views
Interface view
Default command level
2: System level
Parameters
policy-name: Specifies the DDNS policy name, a case-insensitive string of 1 to 32 characters.
fqdn domain-name: Specifies the FQDN to replace <h> in the URL for DDNS update. The domain-name argument is a case-insensitive string of 1 to 127 characters.
Usage guidelines
You can apply at most four DDNS policies to an interface.
If you execute the ddns apply policy command multiple times with the same DDNS policy name but different FQDNs specified, the most recent configuration takes effect, and the device initiates a DDNS update request immediately.
Examples
# Apply the DDNS policy steven_policy to interface Dialer 1 to update the domain name to IP address mapping for FQDN www.whatever.com and enable DDNS update.
<Sysname> system-view
[Sysname] interface Dialer 1
[Sysname-Dialer1] ddns apply policy steven_policy fqdn www.whatever.com
ddns policy
Use ddns policy to create a DDNS policy and enter its view.
Use undo ddns policy to delete the DDNS policy.
Syntax
ddns policy policy-name
undo ddns policy policy-name
Default
No DDNS policy exists.
Views
System view
Default command level
2: System level
Parameters
policy-name: Specifies the DDNS policy name, a case-insensitive string of 1 to 32 characters.
Examples
# Create a DDNS policy named steven_policy and enter its view.
<Sysname> system-view
[Sysname] ddns policy steven_policy
[Sysname-ddns-policy-steven_policy]
display ddns policy
display ddns policy
Use display ddns policy to display information about a DDNS policy.
Syntax
display ddns policy [ policy-name ] [ | { begin | exclude | include } regular-expression ]
Views
Any view
Default command level
1: Monitor level
Parameters
policy-name: Specifies the DDNS policy name, a case-insensitive string of 1 to 32 characters.
|: 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.
Usage guidelines
If no policy name is specified, this command displays information about all DDNS policies.
Examples
# Display information about the DDNS policy steven_policy.
<Sysname> display ddns policy steven_policy
DDNS policy: steven_policy
URL : http://steven:[email protected]/dyndns/update?
system=dyndns&hostname=<h>&myip=<a>
SSL client policy:
Interval : 1 days 0 hours 1 minutes
Table 5 Command output
Field |
Description |
DDNS policy |
DDNS policy name. |
URL |
URL address for the DDNS service. This field is empty if no URL address is configured. |
SSL client policy |
Name of the associated SSL client policy. This field is empty if no associated SSL client policy is configured. |
Interval |
Interval for sending DDNS update requests. |
interval
Use interval to specify the interval for sending DDNS update requests after DDNS update is enabled.
Use undo interval to restore the default value.
Syntax
interval days [ hours [ minutes ] ]
undo interval
Default
The DDNS update request interval is one hour.
Views
DDNS policy view
Default command level
2: System level
Parameters
days: Days in the range of 0 to 365.
hours: Hours in the range of 0 to 23.
minutes: Minutes in the range of 0 to 59.
Usage guidelines
A DDNS update request is initiated immediately after the primary IP address of the interface changes or the link state of the interface changes from down to up.
If you specify the interval as 0, your device initiates a DDNS update request only when the primary IP address of the interface is changed or the link state of the interface changes from down to up.
If you execute the interval command multiple times with different time intervals specified, the most recent configuration takes effect.
Examples
# Set the interval for sending DDNS update requests to one day and one minute for the DDNS policy steven_policy.
<Sysname> system-view
[Sysname] ddns policy steven_policy
[Sysname-ddns-policy-steven_policy] interval 1 0 1
display ddns policy
ssl client policy
Use ssl client policy to associate an SSL client policy with a DDNS policy.
Use undo ssl client policy to remove the association.
Syntax
ssl client policy policy-name
undo ssl client policy
Default
No SSL client policy is associated with any DDNS policies.
Views
DDNS policy view
Default command level
2: System level
Parameters
policy-name: Specifies the SSL client policy name, a case-insensitive string of 1 to 16 characters.
Usage guidelines
The SSL client policy is only effective for the HTTPS-based DDNS update requests.
If you execute the ssl client policy command multiple times with different SSL client policies, the most recent configuration takes effect.
Examples
# Associate the SSL client policy ssl_policy with the DDNS policy steven_policy.
<Sysname> system-view
[Sysname] ddns policy steven_policy
[Sysname-ddns-policy-steven_policy] ssl client policy ssl_policy
· display ddns policy
· ssl client-policy (Security Command Reference)
url
Use url to specify the URL address for DDNS update requests.
Use undo url to delete the URL address.
Syntax
url request-url
undo url
Default
No URL address is specified for DDNS update requests.
Views
DDNS policy view
Default command level
2: System level
Parameters
request-url: Specifies the URL address for DDNS update requests, a case-sensitive string of 1 to 240 characters including the login ID, password, and other information.
Usage guidelines
The format of the URL address to be specified for DDNS update requests depends on the DDNS server.
· Specify the URL address for contacting the HTTP-based DDNS server at www.3322.org as follows:
http://username:password@members.3322.org/dyndns/update?system=dyndns&hostname=<h>&myip=<a>
· Specify the URL address for contacting the TCP-based PeanutHull server as follows:
oray://username:password@phservice2.oray.net
Follow these guidelines when you configure the URL address:
· Replace the parameters username and password in the URL with your actual login ID and password for the DDNS server, respectively.
· The members.3322.org and phservice2.oray.net are the domain names of DDNS servers. The domain names of PeanutHull DDNS servers can be phservice2.oray.net, phddns60.oray.net, client.oray.net, ph031.oray.net, and so on. Determine the domain name in the URL according to the actual situation.
· The port number in the URL address is optional. If no port number is specified, the default port number is used. HTTP uses port 80, HTTPS uses port 443, and the PeanutHull server uses port 6060.
· The system automatically fills <h> with the FQDN that is specified when the DDNS policy is applied to the interface and automatically fills <a> with the primary IP address of the interface to which the DDNS policy is applied. You may also manually specify an FQDN and an IP address in <h> and <a>, respectively. After that, the FQDN that is specified when the DDNS policy is applied becomes ineffective. However, manual configuration of <h> and <a> is not recommended.
· You cannot specify an FQDN and IP address in the URL address for contacting the PeanutHull server. Instead, you can specify an FQDN when applying the DDNS policy to an interface. The system automatically uses the primary IP address of the interface to which the DDNS policy is applied as the IP address for DDNS update.
· To avoid misinterpretation, do not include colons (:), at signs (@), and question marks (?) in your login ID or password, even if you can do so.
· If you execute the url command multiple times with different URL addresses, the most recent configuration takes effect.
Examples
# Specify the URL address for DDNS policy steven_policy with login ID steven and password nevets. The device contacts www.3322.org for DDNS update.
<Sysname> system-view
[Sysname] ddns policy steven_policy
[Sysname-ddns-policy-steven_policy] url http://steven:[email protected]/dyndns/update?system=dyndns&hostname=<h>&myip=<a>
Related commands
display ddns policy