36-DNS Operation

Download


Chapter 1  DNS Configuration

1.1  DNS Overview

Domain name system (DNS) is a distributed database system that provides domain name-to-IP address mappings for TCP/IP applications. With DNS, users using IP applications can directly use meaningful easy-to-remember domain names, which will be resolved and mapped to corresponding IP addresses by DNS servers.

There are two types of DNS resolution, static and dynamic. When a name query is received, the static resolution is first performed to check the static DNS list. If the static resolution fails, the dynamic resolution is performed to look up the dynamic DNS list. Because dynamic resolution needs the participating of DNS server and may spend some time, you can put some commonly used domain names in the static DNS list to increase the resolution efficiency.

1.1.1  Static DNS Resolution

With static DNS resolution, you can manually configure some name-to-address mappings in the static DNS list, and the system will search the static list for corresponding IP addresses when users use domain names with some applications (such as telnet).

1.1.2  Dynamic DNS Resolution

I. Resolving procedure

The procedure of dynamic DNS resolution is as follows:

1)         A user program sends a name query to the resolver in the DNS Client.

2)         The DNS resolver looks up the local DNS cache for a match. If a match is found, it returns the corresponding IP address to the user program. If not, it sends a query to the DNS Server.

3)         The DNS Server looks up its database for a match. If no match is found, it sends a query to its parent DNS Server. If the parent DNS Server does not have the information, it sends the query to another server. This process continues until a result (either successful or failed) is found. Finally, the resolution result is returned to the DNS Client.

4)         The DNS Client performs the next operation according to the result.

Figure 1-1 Dynamic DNS resolution

Figure 1-1 shows the relationship between the user program, DNS Client and DNS Server.

The resolver and cache compose the DNS Client. The user program can run on the same machine as the DNS client, while the DNS Server and the DNS Client must run on different machines.

Dynamic DNS resolution allows the DNS Client to store the latest name-to-address mappings in the dynamic domain name cache. So there is no need to send a request to the DNS Server for the same domain next time. The DNS Client removes aged mappings from the cache, so as to obtain updated mappings from the DNS Server. The setting on the DNS Server determines the aging time, and the DNS Client gets the information from DNS messages.

II. DNS suffix list

The DNS Client normally holds a DNS suffix list where you can define some domain name suffixes. It is used when the name to be resolved is not complete. The resolver can use the list to supply the missing part. For example, you can configure a suffix "com" in the list, and users only need to input "aabbcc" to get the IP address of aabbcc.com, for the resolver will automatically add the suffix and delimiter before passing the name to the DNS Server.

When a user input a domain name:

l           If there is no dot in the domain name, such as “aabbcc”, the resolver will consider this as a host name and add a suffix to the name before performing DNS lookup. If all the suffixes in the DNS suffix list have been tried but no DNS lookup succeeds, the resolver will use the original name (such as aabbcc) for a DNS lookup.

l           If there is a dot in the domain name, such as “www.aabbcc”, the resolver will first use this domain name to perform DNS lookup before trying any other suffix.

l           If there is a dot at the end of the domain name, such as “aabbcc.”, the resolver will remove the dot and use the remaining part of the name (aabbcc) to perform DNS lookup. If the lookup fails, the resolver adds a suffix to the name and performs another DNS lookup; this proceeds until a DNS lookup succeeds or all the suffixes in the list have been tried.

Currently, the S7500 series Ethernet switches support both static and dynamic domain name resolution on the DNS Client.

1.2  Configuring Static DNS Resolution

Table 1-1 Configure static DNS resolution

Operation

Command

Description

Enter system view

system-view

Add a hostname-to-address mapping entry

ip host hostname ip-address

Required

There is no entry in the static DNS list by default.

 

&  Note:

As one hostname can mapped to only one IP address, when you add multiple hostname-to-address mapping entries with the same hostname, only the last one will be valid.

You can add up to 50 entries for static DNS resolution.

 

1.3  Configuring Dynamic DNS Resolution

1.3.1  Configuration Procedure

Table 1-2 Configure dynamic DNS resolution

Operation

Command

Description

Enter system view

system-view

Enable dynamic DNS resolution

dns resolve

Required

This function is disabled by default.

Configure a DNS server IP address

dns server ip-address

Required

No DNS server IP address is configured by default.

Configure a DNS suffix

dns domain domain-name

Optional

No DNS suffix is configured by default.

 

&  Note:

You can configure up to 6 DNS servers and 10 DNS suffixes.

 

1.3.2  DNS Configuration Example

I. Network requirements

As shown in Figure 1-2, an S7506 is used as a DNS client with dynamic DNS resolution. It allows you to visit host 1 with IP address 3.1.1.1/16. The DNS server IP address is 2.1.1.2/16. The DNS suffixes "com" and "net" are configured.

II. Network diagram

Figure 1-2 Network diagram for dynamic DNS resolution

III. Configuration procedure

 

&  Note:

Before doing the following configuration, suppose the route between the S7506 and host 1 is reachable, the DNS server works normally, and a mapping entry from host 1 to IP address 3.1.1.1/16 exists on the DNS server.

 

# Enable dynamic DNS resolution.

<H3C> system-view

[H3C] dns resolve

# Configure the DNS server IP address 2.1.1.2.

[H3C] dns server 2.1.1.2

# Configure net as a DNS suffix.

[H3C] dns domain net

# Configure com as a DNS suffix.

[H3C] dns domain com

Ping host 1 on the S7505 to verify the configuration and the corresponding IP address (it should be 3.1.1.1).

1.4  Displaying and Maintaining DNS

After the above configuration, you can execute the display command in any view to view the DNS configuration and running information to verify your configuration. And you can execute the reset command to clear the dynamic DNS cache.

Table 1-3 Display and maintain DNS

Operation

Command

Description

Display static DNS list information

display ip host

You can execute the display command in any view.

Display DNS server information

display dns server [ dynamic ]

Display DNS suffix list information

display dns domain

Display dynamic DNS cache information

display dns dynamic-host

Clear the dynamic DNS cache.

reset dns dynamic-host

Execute the reset command in user view.

 

1.5  Troubleshooting DNS Configuration

I. Symptom

Dynamic DNS resolution is enabled, but the user cannot get the correct IP address from a domain name.

II. Solution

l           Use the display dns dynamic-host command to check if the specified domain name is in the cache.

l           If the specified domain name is in the cache, but the IP address is wrong, ensure that the DNS Client has the correct IP address of the DNS Server.

l           If the specified domain name is not in the cache, ensure that dynamic DNS resolution is enabled, the DNS Client can normally communicate with the DNS Server, and the DNS Server works normally.

l           Check the DNS mapping list is correct on the DNS Server.