- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
04-DNS Commands | 70.36 KB |
1 IPv4 DNS Configuration Commands
IPv4 DNS Configuration Commands
2 IPv6 DNS Configuration Commands
IPv6 DNS Configuration Commands
l Support of the H3C WA series WLAN access points (APs) for commands may vary by AP model. For more information, see Feature Matrix.
l The interface types and the number of interfaces vary by AP model.
l The models listed in this document are not applicable to all regions. Please consult your local sales office for the models applicable to your region.
IPv4 DNS Configuration Commands
display dns domain
Syntax
display dns domain [ dynamic ]
View
Any view
Default Level
1: Monitor level
Parameters
dynamic: Displays the domain name suffixes dynamically obtained through DHCP or other protocols.
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-1 display dns domain command 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 dynamic-host
Syntax
display dns dynamic-host
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display dns dynamic-host command to display the information of the dynamic IPv4 domain name resolution cache.
Related command: reset dns dynamic-host.
Examples
# Display the information of the dynamic IPv4 domain name resolution cache.
<Sysname> display dns dynamic-host
No. Host IP Address TTL
1 www.baidu.com 202.108.249.134 63000
2 www.yahoo.akadns.net 66.94.230.39 24
3 www.hotmail.com 207.68.172.239 3585
4 www.eyou.com 61.136.62.70 3591
Table 1-2 display dns dynamic-host command output description
Field |
Description |
No |
Sequence number |
Host |
Domain name |
IP Address |
IPv4 address for the corresponding domain name |
TTL |
Time that a mapping can be stored in the cache (in seconds). |
A domain name in the display dns dynamic-host command contains 21 characters at most. If a domain name consists of more than 21 characters, only the first 21 characters are displayed.
display dns server
Syntax
display dns server [ dynamic ]
View
Any view
Default Level
1: Monitor level
Parameters
dynamic: Displays the DNS server information dynamically obtained through DHCP or other protocols
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 1-3 display dns server command output description
Field |
Description |
DNS Server |
Sequence number of the DNS server, configured automatically by the AP, 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
View
Any view
Default Level
1: Monitor level
Parameters
None
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 1-4 display ip host command 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 IP addresses. |
Flags |
Indicates the mapping type, static or dynamic. Static represents static domain name resolution. |
Address |
Host IP 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, that is, only the provided domain name is resolved.
Note that:
l The domain name suffix configured with the dns domain command is applicable to both IPv4 DNS and IPv6 DNS.
l 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.
Note that 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 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 that:
l In system view, you can configure up to six DNS servers, including those with IPv6 addresses. The total number of DNS servers configured in interface view must be within six.
l 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.
l The DNS server configured in system view has a higher priority than the DNS server configured in interface view. That is, a name query request is first sent to each DNS server configured in system view; if no rely is obtained, the request is sent to each DNS server configured in interface view in turn.
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 20 characters, including case-insensitive letters, numbers, hyphens (-), 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.
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 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 dynamic-host
Syntax
reset dns dynamic-host
View
User view
Default Level
2: System level
Parameters
None
Description
Use the reset dns dynamic-host command to clear the dynamic IPv4 domain name resolution information.
Related commands: display dns dynamic-host.
Examples
# Clear the dynamic IPv4 domain name resolution information.
<Sysname> reset dns dynamic-host
Support for the IPv6 DNS configuration commands depends on the AP model.
IPv6 DNS Configuration Commands
display dns ipv6 dynamic-host
Syntax
display dns ipv6 dynamic-host
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display dns ipv6 dynamic-host command to display the information of the dynamic IPv6 domain name cache, including the host name, IPv6 address, and TTL of the DNS entries.
You can use the reset dns ipv6 dynamic-host command to clear all the information of the dynamic IPv6 domain name cache.
Examples
# Display the information of the dynamic IPv6 domain name cache.
<Sysname> display dns ipv6 dynamic-host
No. Host IPv6 Address TTL
1 aaa 2001::2 6
Table 2-1 display dns ipv6 dynamic-host command output description
Field |
Description |
No. |
Sequence number |
Host |
Host name |
IPv6 Address |
IPv6 address of the host |
TTL |
Time within which an entry can be cached, in seconds |
For a domain name displayed with the display dns ipv6 dynamic-host command, no more than 21 characters can be displayed. If the domain name exceeds the maximum length, the first 21 characters are displayed.
display dns ipv6 server
Syntax
display dns ipv6 server [ dynamic ]
View
Any view
Default Level
1: Monitor level
Parameters
dynamic: Displays IPv6 DNS server information acquired dynamically through DHCP or other protocols.
Description
Use the display dns ipv6 server command to display IPv6 DNS server information.
Examples
# Display IPv6 DNS server information.
<Sysname> display dns ipv6 server
Type:
D:Dynamic S:Static
DNS Server Type IPv6 Address (Interface Name)
1 S 1::1
2 S FE80:1111:2222:3333:4444:5555:6666:7777 Vlan2
Table 2-2 display dns ipv6 server command output description
Field |
Description |
DNS Server |
Sequence number of the DNS server, which is assigned automatically by the system, starting from 1. |
Type |
Type of the DNS server: “S” represents a statically configured DNS server, and “D” represents a DNS server obtained dynamically through DHCP or other protocols. |
IPv6 Address |
IPv6 address of the DNS server |
Interface Name |
Interface name, which is available only for a DNS server with an IPv6 link-local address configured. |
display ipv6 host
Syntax
display ipv6 host
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display ipv6 host command to display the mappings between host names and IPv6 addresses in the static domain name resolution table.
Related commands: ipv6 host.
Examples
# Display the mappings between host names and IPv6 addresses in the static domain name resolution table.
<Sysname> display ipv6 host
Host Age Flags IPv6Address
aaa 0 static 2002::1
bbb 0 static 2002::2
Table 2-3 display ipv6 host command output description
Field |
Description |
Host |
Host name |
Age |
Time for the entry to live. “0” is displayed in the case of static configuration. |
Flags |
Type of the mapping. Static indicates a static mapping. |
IPv6Address |
IPv6 address of a host |
dns server ipv6
Syntax
dns server ipv6 ipv6-address [ interface-type interface-number ]
undo dns server ipv6 ipv6-address [ interface-type interface-number ]
View
System view
Default Level
2: System level
Parameters
ipv6-address: IPv6 address of a DNS server.
interface-type interface-number: Specifies an interface. When the IPv6 address of the DNS server is a link-local address, the two arguments must be specified.
Description
Use the dns server ipv6 command to specify a DNS server.
Use the undo dns server ipv6 command to remove the specified DNS server.
By default, no DNS server is configured.
You can configure a maximum of six DNS servers, including those with IPv4 addresses.
Examples
# Specify a DNS server at 2002::1.
<Sysname> system-view
[Sysname] dns server ipv6 2002::1
ipv6 host
Syntax
ipv6 host hostname ipv6-address
undo ipv6 host hostname [ ipv6-address ]
View
System view
Default Level
2: System level
Parameters
hostname: Host name, a string of 1 to 20 characters. The character string can contain letters, numbers, underscores (_), hyphens (-), or dots (.) and must contain at least one letter.
ipv6-address: IPv6 address.
Description
Use the ipv6 host command to configure a mapping between host name and IPv6 address.
Use the undo ipv6 host command to remove a mapping between host name and IPv6 address.
No mappings are created by default.
Each host name can correspond to only one IPv6 address. The IPv6 address you last assign to the host name will overwrite the previous one if there is any.
Related commands: display ipv6 host.
Examples
# Configure the mapping between a host name and an IPv6 address.
<Sysname> system-view
[Sysname] ipv6 host aaa 2001::1
reset dns ipv6 dynamic-host
Syntax
reset dns ipv6 dynamic-host
View
User view
Default Level
2: System level
Parameters
None
Description
Use the reset dns ipv6 dynamic-host command to clear the information of the IPv6 dynamic domain name cache.
You can use the display dns ipv6 dynamic-host command to display the information of the current IPv6 dynamic domain name cache.
Examples
# Clear the information of the IPv6 dynamic domain name cache.
<Sysname> reset dns ipv6 dynamic-host