- Table of Contents
-
- 04-Layer 3 Configuration Guide
- 00-Preface
- 01-Basic IP Routing Configuration
- 02-Static Routing Configuration
- 03-IPv6 Static Routing Configuration
- 04-IP Addressing Configuration
- 05-IPv6 Basics Configuration
- 06-DHCP Configuration
- 07-DHCPv6 Configuration
- 08-DNS Configuration
- 09-IPv6 DNS Configuration
- 10-IP Performance Optimization Configuration
- 11-ARP Configuration
- 12-IP Forwarding Basics Configuration
- 13-NAT Configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
08-DNS Configuration | 230.45 KB |
Dynamic domain name resolution
Configuring the IPv4 DNS client
Configuring static domain name resolution
Configuring dynamic domain name resolution
Specifying the source interface for DNS packets
Displaying and maintaining IPv4 DNS
IPv4 DNS configuration examples
Static domain name resolution configuration example
Dynamic domain name resolution configuration example
Troubleshooting IPv4 DNS configuration
Overview
Domain Name System (DNS) is a distributed database used by TCP/IP applications to translate domain names into IP addresses. With DNS, you can use easy-to-remember domain names in some applications and let the DNS server translate them into correct IP addresses.
DNS services can be static or dynamic. After a user specifies a name, the device checks the local static name resolution table for an IP address. If no IP address is available, it contacts the DNS server for dynamic name resolution, which takes more time than static name resolution. To improve efficiency, you can put frequently queried name-to-IP address mappings in the local static name resolution table.
Static domain name resolution
Static domain name resolution means setting up mappings between domain names and IP addresses. IP addresses of the corresponding domain names can be found in the static domain resolution table when you use applications such as Telnet.
Dynamic domain name resolution
Resolution process
1. A user program sends a name query to the resolver of the DNS client.
2. The DNS resolver looks up the local domain name cache for a match. If the resolver finds a match, it sends the corresponding IP address back. If not, it sends a query to the DNS server.
3. The DNS server looks up the corresponding IP address of the domain name in its DNS database. If no match is found, the server sends a query to a higher level DNS server. This process continues until a result, whether successful or not, is returned.
4. After receiving a response from the DNS server, the DNS client returns the resolution result to the application.
Figure 1 Dynamic domain name resolution
Figure 1 shows the relationship between the user program, DNS client, and DNS server.
The DNS client comprises the resolver and cache. The user program and DNS client can run on the same device or different devices, but the DNS server and the DNS client usually run on different devices.
Dynamic domain name resolution allows the DNS client to store the latest mappings between domain names and IP addresses in the dynamic domain name cache. The DNS client does not need to send a request to the DNS server for a repeated query next time. The aged mappings are removed from the cache, and latest entries are required from the DNS server. The DNS server decides how long a mapping is valid, and the DNS client gets the aging information from DNS messages.
DNS suffixes
The DNS client holds a list of user-specified suffixes. The resolver can use the list to supply the missing part of incomplete names.
For example, a user can configure com as the suffix for aabbcc.com. The user only needs to type aabbcc to obtain the IP address of aabbcc.com because the resolver adds the suffix and delimiter before passing the name to the DNS server.
· If there is no dot (.) in the domain name (for example, aabbcc), the resolver considers this a host name and adds a DNS suffix before the query. If no match is found after all the configured suffixes are used respectively, the original domain name (for example, aabbcc) is used for the query.
· If there is a dot (.) in the domain name (for example, www.aabbcc), the resolver directly uses this domain name for the query. If the query fails, the resolver adds a DNS suffix for another query.
· If the dot (.) is at the end of the domain name (for example, aabbcc.com.), the resolver considers it a Fully Qualified Domain Name (FQDN) and returns the query result, successful or failed. The dot at the end of the domain name is considered a terminating symbol.
The device supports static and dynamic DNS client services.
|
NOTE: If an alias is configured for a domain name on the DNS server, the device can resolve the alias into the IP address of the host. |
Configuring the IPv4 DNS client
Configuring static domain name resolution
Configuring static domain name resolution refers to specifying the mappings between host names and IPv4 addresses. Static domain name resolution allows applications such as Telnet to contact hosts by using host names instead of IPv4 addresses.
To configure static domain name resolution:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Configure a mapping between a host name and an IPv4 address. |
ip host hostname ip-address |
Not configured by default. The IPv4 address you last assign to the host name overwrites the previous one if there is any. You may create up to 50 static mappings between domain names and IPv4 addresses. |
Configuring dynamic domain name resolution
To send DNS queries to a correct server for resolution, you must enable dynamic domain name resolution and configure a DNS server.
In addition, you can configure a DNS suffix that the system automatically adds to the provided domain name for resolution.
Configuration guidelines
Follow these guidelines when you configure dynamic domain name resolution:
· You can configure up to six DNS servers, including those with IPv6 addresses, in system view, 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. A name query request is first sent to the DNS server that has the highest priority. If no reply is received, it is sent to the DNS server that has the second highest priority, and so on in turn.
· You can specify up to ten DNS suffixes.
Configuration procedure
To configure dynamic domain name resolution:
Command |
Remarks |
|
1. Enter system view. |
system-view |
N/A |
2. Enable dynamic domain name resolution. |
dns resolve |
Disabled by default. |
3. Specify a DNS server. |
·
Approach 1 (In system
view): · Approach 2 (In interface view): a. interface interface-type interface-number b. dns server ip-address c. quit |
Use at least one approach. No DNS server is specified by default. |
4. Configure a DNS suffix. |
dns domain domain-name |
Optional. By default, no DNS suffix is configured and only the provided domain name is resolved. |
Specifying the source interface for DNS packets
By default, the device uses the primary IP address of the output interface of the matching route as the source IP address of a DNS request. Therefore, the source IP address of the DNS packets may vary with DNS servers. In some scenarios, the DNS server only responds to DNS requests sourced from a specific IP address. In such cases, you must specify the source interface for the DNS packets so that the device can always use the primary IP address of the specified source interface as the source IP address of DNS packets.
To specify the source interface for DNS packets:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Specify the source interface for DNS packets. |
dns source-interface interface-type interface-number |
By 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. |
Displaying and maintaining IPv4 DNS
Task |
Command |
Remarks |
Display the static IPv4 domain name resolution table. |
display ip host [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display IPv4 DNS server information. |
display dns server [ dynamic ] [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display DNS suffixes. |
display dns domain [ dynamic ] [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display the information of the dynamic IPv4 domain name cache. |
display dns host ip [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Clear the information of the dynamic IPv4 domain name cache. |
reset dns host ip |
Available in user view. |
IPv4 DNS configuration examples
Static domain name resolution configuration example
Network requirements
As shown in Figure 2, the AP wants to access the host by using an easy-to-remember domain name rather than an IP address.
Configure static domain name resolution on the AP so that the device can use the domain name host.com to access the host whose IP address is 10.1.1.2.
Configuration procedure
# Configure a mapping between host name host.com and IP address 10.1.1.2.
<AP> system-view
[AP] ip host host.com 10.1.1.2
# Use the ping host.com command to verify that the AP can use static domain name resolution to resolve domain name host.com into IP address 10.1.1.2.
[AP] ping host.com
PING host.com (10.1.1.2):
56 data bytes, press CTRL_C to break
Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=128 time=1 ms
Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=128 time=4 ms
Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=128 time=3 ms
Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=128 time=2 ms
Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=128 time=3 ms
--- host.com ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/2/4 ms
Dynamic domain name resolution configuration example
Network requirements
As shown in Figure 3, the IP address of the DNS server is 2.1.1.2/16 and the name suffix is com. The mapping between domain name host and IP address 2.1.1.10/16 is stored in the com domain.
The AP acting as a DNS client uses the dynamic domain name resolution and the suffix to access the host with the domain name host.com and the IP address 2.1.1.10/16.
Configuration procedure
Before performing the following configuration, make sure there is a route between the AP and the host, and configurations are done on both the AP and the host. For the IP addresses of the interfaces, see Figure 3.
This configuration may vary with DNS servers. The following configuration is performed on a Windows server 2000 PC.
1. Configure the DNS server:
# Enter DNS server configuration page.
Select Start > Programs > Administrative Tools > DNS.
# Create zone com.
In Figure 4, right click Forward Lookup Zones, select New Zone, and then follow the instructions to create a new zone.
Figure 4 Create a zone
# Create a mapping between the host name and IP address.
In Figure 5, right click zone com, and then select New Host to bring up a dialog box as shown in Figure 6. Enter host name host and IP address 2.1.1.10.
Figure 6 Add a mapping between domain name and IP address
2. Configure the DNS client (AP):
# Enable dynamic domain name resolution.
<AP> system-view
[AP] dns resolve
# Specify the DNS server 2.1.1.2.
[AP] dns server 2.1.1.2
# Configure com as the domain name suffix.
[AP] dns domain com
3. Configuration verification:
# Execute the ping host command on the AP to verify that the communication between the AP and the host is normal and that the corresponding destination IP address is 2.1.1.10.
[AP] ping host
Trying DNS resolve, press CTRL_C to break
Trying DNS server (2.1.1.2)
PING host.com (2.1.1.10):
56 data bytes, press CTRL_C to break
Reply from 2.1.1.10: bytes=56 Sequence=1 ttl=126 time=3 ms
Reply from 2.1.1.10: bytes=56 Sequence=2 ttl=126 time=1 ms
Reply from 2.1.1.10: bytes=56 Sequence=3 ttl=126 time=1 ms
Reply from 2.1.1.10: bytes=56 Sequence=4 ttl=126 time=1 ms
Reply from 2.1.1.10: bytes=56 Sequence=5 ttl=126 time=1 ms
--- host.com ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/3 ms
Troubleshooting IPv4 DNS configuration
Symptom
After enabling dynamic domain name resolution, the user cannot get the correct IP address.
Solution
1. Use the display dns host ip command to verify that the specified domain name is in the cache.
2. If the specified domain name does not exist, check that dynamic domain name resolution is enabled and that the DNS client can communicate with the DNS server.
3. If the specified domain name is in the cache, but the IP address is incorrect, check that the DNS client has the correct IP address of the DNS server.
4. Verify that the mapping between the domain name and IP address is correct on the DNS server.