Configuring Dynamic DNS (DDNS) in the Cisco IOS

Would you like to host a web server or e-mail server on your Internet connection, but don’t want to pay for a static IP address? Dynamic DNS (DDNS) is here to allow you to host that website while still using a dynamic IP address. Previously, this was only available as an executable computer program, or was offered on some small home routers. However, with IOS version 12.4 (and some versions of 12.3), DDNS is now available in the Cisco IOS.

What can DDNS do for me?

The problem with hosting a web server, or email server, on an Internet link that has a dynamic IP address is that your IP address could change. For example, you might register your website as www.mywebsite.com and point it to IP address 20.20.20.20. Later, your IP address could change to 30.30.30.30 and all the users trying to get to your website suddenly cannot connect. You would then have to update your DNS record and that change could take a couple of days to propagate to all Internet DNS servers. The result is some serious downtime for your server.

DDNS solves this issue by monitoring your IP address and, if it changes, that change is immediately reported to your DNS provider. This DNS provider is the only host of that domain and, thus, the DNS record is instantly updated when your IP address changes. There should be only seconds of downtime for any users trying to connect to your web or mail server.

DDNS Background

In smaller routers, DDNS has been available for some time. For example, here is screenshot of a Linksys router:

configuring dynamic dns 01 small

Notice how the DDNS server, DynDNS.org, is selected. To make it work, you must have an account with them; fill in your username, password, and DNS hostname. The router already knows your dynamic IP address and it will register it with DynDNS.org. The downside to this is that this router only offers two DDNS services (DynDNS being one of them). Thus, you have limited selection on which service to use, and no troubleshooting tools if it doesn’t work.

In the Cisco IOS, you must first have the proper IOS to use DDNS. To be safe, any version of IOS 12.4 will work. However, the easiest way to see if you have DDNS available on your router is to go to global configuration and type ip ddns ?. Here is output from two routers. The first router has DDNS, the second does not:

configuring dynamic dns 02 small

configuring dynamic dns 03 small

In other words, if you have DDNS, you will receive the option to update your DDNS.

How can I configure DDNS in the Cisco IOS?

How to configure DDNS varies based on the DDNS service you choose. The IOS supports two methods for performing DDNS updates: the popular generic HTTP and the IETF standard based on RFC 2136.

Cisco offers sample configuration strings for the following 7 DDNS services that use HTTP as an update method:

  • DDNS
  • TZO
  • EASYDNS
  • JUSTLINUX
  • DYNS
  • HN
  • ZONEEDIT

If you don’t have a DDNS service already, I would recommend choosing one of these, or choose one that offers their own instructions for configuring DDNS on a Cisco router, such as these configurations for the Cisco IOS DDNS service from no-ip.com.

As the configuration for DDNS in the Cisco IOS varies based on your method and provider, let me show you a basic configuration example:

configuring dynamic dns 04 small

In this example, we used the command ip ddns update method {methodname}. This put us in DDNS-update-method configuration mode. We then specified our method to be HTTP. After that, we typed in the URL for our DDNS provider. This URL includes our username, password, DDNS hostname, and our dynamically added IP address. Here is the URL we entered:

add http://test:[email protected]/nic/update?system=dyndns&hostname=<h>&myip=<a>

Please note that prior to typing the “?” in the line, you must press Ctrl-V to allow for the question mark. If you don’t, you will be prompted with IOS context-sensitive help information.

After the URL, using the interval maximum command, we told the IOS to update the DDNS record with the provider every day.

Finally, we went into the interface configuration mode and specified the DDNS update hostname and enabled DDNS for that interface.

Prior to this configuration, DHCP should have been configured on the router.

Please note that this article is not meant to be a complete configuration guide. DDNS configuration varies so much based on the provider and the number of options you want to include. There are many more options than these. For more complete information on this topic, please see the Cisco IOS Product Feature Guide for DDNS, and the Cisco IOS 12.4 Command Reference for ip ddns.

Article Summary

Having DDNS built into the IOS makes it much more reliable than having a PC client. Even better, the IOS offers powerful debugging tools for DDNS by using the show ip ddns update and debug ip ddns update commands. For those who have dynamic IP addresses and want to host a server, DDNS is virtually a requirement. In summary, DDNS is a powerful feature to have available in your Cisco IOS router.