Example: Configuring DDNS with www.3322.org
Network configuration
As shown in Figure 52, the switch is a Web server with domain name whatever.3322.org and uses an IP address dynamically obtained through DHCP. To make sure the switch can always provide Web services at whatever.3322.org when its IP address changes, perform the following tasks on the switch:
Configure a DDNS policy to update the switch's domain name-to-IP address mapping on the DDNS server. The DDNS server then updates the mapping on the DNS server.
Specify the IP address of the DNS server so that the switch can access the DDNS server through domain name.
Figure 52: Network diagram
Procedure
IMPORTANT: By default, interfaces on the device are disabled (in ADM or Administratively Down state). To have an interface operate, you must use the undo shutdown command to enable that interface. | ||
Before configuring DDNS on the switch, perform the following tasks:
Register with username steven and password nevets at http://www.3322.org/.
Configure a DDNS policy to update the mapping between the switch's FQDN and IP address.
Make sure the devices can reach each other.
# Create a DDNS policy named 3322.org, and enter its view.
<Switch> system-view [Switch] ddns policy 3322.org
# Specify the URL address, username, and password for DDNS update requests.
[Switch-ddns-policy-3322.org] url http://members.3322.org/dyndns/update?system=dyndns&hostname=<h>&myip=<a> [Switch-ddns-policy-3322.org] username steven [Switch-ddns-policy-3322.org] password simple nevets
# Set the interval to 15 minutes for sending DDNS update requests.
[Switch-ddns-policy-3322.org] interval 0 0 15 [Switch-ddns-policy-3322.org] quit
# Specify the IP address of the DNS server as 1.1.1.1.
[Switch] dns server 1.1.1.1
# Apply DDNS policy 3322.org to VLAN-interface 2 to enable DDNS update. The mapping between domain name whatever.3322.org and the primary IP address of VLAN-interface 2 will be dynamically updated.
[Switch] interface vlan-interface 2 [Switch-Vlan-interface2] ddns apply policy 3322.org fqdn whatever.3322.org
Verifying the configuration
Verify that the switch can update its domain name-IP mapping through the DDNS provider www.3322.org when its IP address changes. The Internet users can resolve the correct IP address through the domain name whatever.3322.org to access the Web service.