- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
03-DNS Commands | 43.11 KB |
Chapter 1 DNS Configuration Commands
1.1 DNS Configuration Commands
1.1.1 debugging dns
Syntax
debugging dns
undo debugging dns
View
User view
Default Level
1: Monitor level
Parameters
None
Description
Use the debugging dns command to enable debugging for dynamic domain name resolution.
Use the undo debugging dns command to disable debugging.
By default, debugging for dynamic domain name resolution is disabled.
Examples
# Enable debugging for dynamic domain name resolution.
<Sysname> debugging dns
succeed in making DNS packet for name aabbcc.com
// A packet querying for domain name aabbcc.com is generated.
send the packet to 172.16.1.1 DNS server for 1 times
// The query packet is sent for the first time to the DNS server at 172.16.1.1.
receive a right answer from server 172.16.1.1
// A correct response is received from the server at 172.16.1.1.
query timeout
// No response is received, and the query times out.
1.1.2 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 Description on fields of display dns domain command
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 |
1.1.3 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 in the dynamic domain name resolution cache.
Examples
# Display the information in the dynamic domain name resolution cache.
<Sysname> display dns dynamic-host
No. Domain-name 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 Description on the field of the display dns dynamic-host command
Field |
Description |
No |
Sequence number |
Domain-name |
Domain name |
Ip Address |
IP address for the corresponding domain name |
TTL |
Time a mapping can be stored in the cache (seconds). |
& Note:
The domain-name field in the display dns dynamic-host command contains 21 characters at most. If a resolved domain name consists of more than 21 characters, only the first 21 characters are displayed.
1.1.4 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 DNS server information.
Related commands: dns server.
Examples
# Display the DNS server information.
<Sysname> display dns server
Type:
D:Dynamic S:Static
IPv4 DNS Servers :
Domain-server Type IP Address
1 S 169.254.65.125
IPv6 DNS Servers :
Domain-server Type IPv6 Address (Interface Name)
1 S FE01:9A2::1
2 S FE80::3 GE4/2/4
Table 1-3 Description on fields of the display dns server command
Field |
Description |
Domain-server |
Sequence number of the DNS server. Configured automatically by the device, starting from 1. Servers with IPv4 or IPv6 addresses are numbered respectively. |
IP Address |
IPv4 address of the DNS server |
IPv6 Address |
IPv6 address of the DNS server |
Interface Name |
Only displayed when the DNS server is configured with an IPv6 address. |
& Note:
For details about IPv6 DNS, refer to IPv6 Basics Configuration in IP Services Volume.
1.1.5 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 IP addresses in the static DNS database.
Examples
# Display the host names and corresponding IP addresses in the static DNS database.
<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 Description on fields of the display ip host command
Field |
Description |
Host |
Host name |
Age |
Time to live. 0 means that a static mapping will never age out. You can only manually remove the mappings between host names and IP addresses. |
Flags |
Indicates the type of mappings between host names and IP addresses, static or dynamic. Static represents static domain name resolution. |
Address |
Host IP addresses |
1.1.6 dns domain
Syntax
dns domain domain-name
undo dns domain [ domain-name ]
View
System view
Default Level
2: System level
Parameters
domain-name: DNS suffix, a case-insensitive string consisting of 1 to 238 characters. A DNS suffix may include letters, digits, hyphens (-), underscores (_), and dots (.).
& Note:
You can use the dns domain command to configure a DNS suffix with the maximum length of 238 characters. Since a valid DNS suffix is a character string separated by dots, with each separated part (label) containing no more than 63 characters, any part exceeding this length may result in failure to generate packets.
Description
Use the dns domain command to configure a DNS suffix. The system can automatically add corresponding suffix to the domain name you entered for resolution, so you can just enter the name part of the domain name.
Use the undo dns domain command to delete a DNS suffix or all DNS suffixes.
No DNS suffix is configured by default.
You can configure a maximum of 10 DNS suffixes. You must enter a suffix name before deleting it. Otherwise, all the statically configured suffixes are deleted.
Related commands: display dns domain.
Examples
# Configure com as a DNS suffix.
[Sysname] dns domain com
1.1.7 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.
Examples
# Enable dynamic domain name resolution.
[Sysname] dns resolve
1.1.8 dns server
Syntax
dns server ip-address
undo dns server [ ip-address ]
View
System view
Default Level
2: System level
Parameters
ip-address: IP address of the DNS server.
Description
Use the dns server command to configure an IP address for the DNS server.
Use the undo dns server to remove the IP address.
No IP address is configured for the DNS server by default.
You can configure a maximum of six DNS servers.
Related commands: display dns server.
Examples
# Configure 172.16.1.1 for the DNS server.
[Sysname] dns server 172.16.1.1
1.1.9 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: IP address of the specified host in dotted decimal notation.
Description
Use the ip host command to create a mapping between host name and IP address in the static resolving list.
Use the undo ip host command to remove the mapping.
No mappings are created by default.
You can configure only one mapping between IP address and host name. For example, a mapping configured last time will overwrite the previous one if there is any.
Related commands: display ip host.
Examples
# Configure the IP address 10.110.0.1 for a host named aaa.
[Sysname] ip host aaa 10.110.0.1
1.1.10 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 information in the dynamic domain name cache.
Related commands: display dns dynamic-host.
Examples
# Clear the information in the dynamic domain name cache.
<Sysname> reset dns dynamic-host