Configuring the Dynamic Domain Name Resolution
Context
For dynamic domain name resolution, the DNS server needs to provide the mapping between domain names and IP addresses and receive domain name resolution requests from clients.
To implement dynamic DNS, you need to enable dynamic DNS resolution, configure the IP address of DNS server, configure a source IP address for the local device to receive DNS packets, and configure a domain name suffix.
Procedure
- Run system-view
The system view is displayed.
- Run dns resolve
Dynamic domain name resolution is enabled.
By default, dynamic DNS resolution is disabled.
- (Optional) Run dns server source-ip ip-address
The source IP address is configured for the local device to receive DNS packets.
By default, no source IP address is configured for the local device to receive DNS packets.
Ensure that the source IP address is the IP address of an interface or logical interface on the device, and there are reachable routes between the interface and the DNS server.
Ensure that the source IP address and the IP address of the DNS server are on the same VPN or public network.
- Run dns server ip-address
The IP address of the DNS server is configured.
By default, no IP address of the DNS server is configured.
- (Optional) Run dns server vpn-instance vpn-instance-name
The device is configured to send DNS query requests to the DNS server on a specified VPN network.
By default, the device can only send DNS query requests to the DNS server on a public network.
If you run this command multiple times, only the latest configuration takes effect.
The device can send DNS query requests to the DNS server on a public network or specified VPN network.
The device can respond to DNS query requests sent by DNS clients on multiple VPN networks.
- (Optional) Run dns domain domain-name
A domain name suffix is configured.
By default, no domain name suffix is configured on a DNS client.
- (Optional) Run dns application cache ttl maximum max-value minimum minimum-value
The maximum value or minimum value of the lifetime for the DNS application cache is a domain name suffix is configured.
- (Optional) Configure the algorithm mode and retransmission mechanism for a device to send DNS query requests to the DNS server.
Run dns-server-select-algorithm { fixed [ dynamic-precedence ] | auto }
The mode for the device to select the DNS server is configured.
By default, the mode for a device to select the DNS server is auto.
Only V300R019C13 and later versions support the dynamic-precedence parameter.
Run dns forward retry-number number
The number of times for the device to retransmit query requests to the destination DNS server is configured.
By default, the number of times for a device to retransmit DNS query requests to the destination DNS server is 2.
Run dns forward retry-timeout time
The retransmission timeout period for DNS query requests sent by the device to the destination DNS server is configured.
By default, the retransmission timeout period for DNS query requests sent by a device to the destination DNS server is 3 seconds.
The total timeout period for DNS query requests configured by dns forward retry-number and dns forward retry-timeout cannot be too short. Generally, the default value is recommended. If the time of waiting for the resolution response from the DNS server is too long, and the service exception is caused, you can prolong the retransmission timeout period as required.