Example for Configuring the DDNS Client (Using the Update Mode Defined by the RFC2136)
Networking Requirements
In Figure 4-9, Router can function as a web server to provide web services for network users and users can access the web server by sending DNS requests. The domain name of the web server is www.abc.com, corresponding to the IP address of GE1/0/0 on Router.
The IP address of GE1/0/0 on Router may change. As a result, if the mapping relationship between the web server's domain name and the IP address is not updated in time on the DNS server, a user access error may occur. Users want to update the mapping relationship between the web server's domain name and the IP address in time on the DNS server when no DDNS server is leased.
There are reachable routes between Router and the DNS server.
Configuration Roadmap
Configure the DDNS client whose update mode is ddns on the router, so that the mapping relationship between the web server's domain name and the IP address can be dynamically updated on the DNS server if the IP address of GE1/0/0 on Router changes.
Procedure
- Configure Router.
# Create and configure a DDNS policy.
<Huawei> system-view [Huawei] sysname Router [Router] ddns policy mypolicy [Router-ddns-policy-mypolicy] method ddns both [Router-ddns-policy-mypolicy] name-server 10.3.1.2 [Router-ddns-policy-mypolicy] quit
# Bind the DDNS policy to GE1/0/0.[Router] interface gigabitethernet 1/0/0 [Router-GigabitEthernet1/0/0] ddns apply policy mypolicy fqdn www.abc.com [Router-GigabitEthernet1/0/0] quit
When the configuration is complete and the IP address of GE1/0/0 changes, Router notifies the DNS server to update the mapping relationship between the domain name www.abc.com and the IP address, ensuring that users can obtain the latest IP address by parsing the domain name www.abc.com.
- Verify the configuration.
# Run the display ddns policy mypolicy command on Router to check information about the DDNS policy named mypolicy.
<Router> display ddns policy mypolicy Policy name : mypolicy Server : 10.3.1.2 User name : - Password : - Update method : ddns both Update interval : 3600 seconds Apply interface : GigabitEthernet1/0/0
# Run the display ddns interface gigabitethernet 1/0/0 command on Router to check information about the DDNS policy of GE1/0/0. (The IP address of the current interface GE1/0/0 is 192.168.10.1. The Client IP field is displayed as the IP address of the DDNS client, and the Server IP field is displayed as the IP address of the DDNS server.)
<Router> display ddns interface gigabitethernet 1/0/0 Policies applied on interface GigabitEthernet1/0/0 : ------------------------------------------------------------------------------ Policy name : mypolicy Server : 10.3.1.2 User name : - Password : - Update method : ddns both Update interval : 3600 seconds Current status : ESTABLISH Client FQDN : www.abc.com Client IP : 192.168.10.1 Server IP : - Last update time : 2015-07-22 09:33:26 Last update result : Success