05-DNS Commands
Chapters Download (37.34 KB)
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 |
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 commands: 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.
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 device, 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 |
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 static mappings between host names and IPv4 addresses. |
Flags |
Indicates the mapping type. Static represents static IPv4 domain name resolution. |
Address |
Host IPv4 address |
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,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
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.
Examples
# Enable dynamic domain name resolution.
<Sysname> system-view
[Sysname] dns resolve
Syntax
dns server ip-address
undo dns server [ ip-address ]
View
System 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.
You can configure a maximum of six DNS servers.
Related commands: display dns server.
Examples
# Specify the DNS server 172.16.1.1.
<Sysname> system-view
[Sysname] dns server 172.16.1.1
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 (-), underscores (_), 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
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 information of the dynamic IPv4 domain name resolution cache.
Related commands: display dns dynamic-host.
Examples
# Clear the information of the dynamic IPv4 domain name resolution cache.
<Sysname> reset dns dynamic-host