Normally we try to setup static IP addresses for our managed routers. However in this case the router was residential and in Singapore. Getting a static IP address was actually impossible.
I started the project by researching DDNS providers. Many of the DDNS providers that were free in the pase are no-longer free. However no-ip.com still offers a free version of DDNS. The free version is under the section of their website for personal. At this time I could not find any statements on their site restricting the service to personal use. Here is a link to their site.
This procedure is easy to perform but due to lack of proper documentation and a lot of incorrect documentation, including that in the no-ip.com knowledgebase, it is more difficult than it should be.
This article assumes you have a basic knowledge of Cisco routers and know how to get into config mode and how to save your configuration.
There are three primary steps to setting up DDNS on a Cisco IOS router.
1. Setup and confirm DNS resolution works.
2. Setup a DDNS method to be called.
3. Setup the external DHCP interface to call the DDNS update method.
Setup DNS resolution.
Confirm your router can ping something by name properly. A simple ‘ping google.com’ is an effective test. If it does not work you can setup you router DNS to use Google’s public DNS servers with these two config lines:
-ip dns server
-ip name-server 188.8.131.52 184.108.40.206
Setup the DDNS method.
The method tells the router how to contact the DDNS provider, login and send the proper update command. It also controls the minimum and maximum time between DDNS updates. Do not set the maximum time too short. Many DDNS providers will lock you out if you update too frequently. I typically use one day but you need to check with your provider.
Create and name the DDNS update method.
-ip ddns update method ddns-noip
Set the update mode to HTTP
Create the ADD URL. The URL contains some special characters mainly the’?’ that is problematic to enter because the router interprets it as a call for help. Use CTRL-V just before typing the ‘?’ and the router will place it properly. Replace [username] and password with your no-ip credentials. You will need to enter your username as an email address including the ‘@’
<h>&myip=<a> is a macro replaced by the router during the update with hostname and ip. i.e. hostname=myhostname.no-ip.org&myip=220.127.116.11′
– add http://[username]:[Password]@dynupdate.no-ip.com/nic/update?hostname=<h>&myip=<a>
update minimum every 5 minutes maximum 1 day.
interval maximum 1 0 0 0
interval minimum 0 0 5 0
Apply the update to the external DHCP interface.
Select the external interface and apply the update command to call the method you just created. For the Cisco 871 router used in this configuration it is FastEthernet 4. Replace it with your proper interface. For PPPoE it is likely interface Dialer 0.
Substitute your DDNS method name and the hostname to update at your DDNS provider with your specific details..
ip ddns update hostname [DDNS hostname]
ip ddns update ddns-noip
Unfortunately I have not figured out a way to force a DDNS update NOW. What you can do is set your maximum update time short like 5 minutes. Turn on debugging with: debug ip ddns update. You will get some very useful debug information. Make sure all the parameters are correct on the calls.
You may need to reload your router. I have round that changing the add command did not update properly after some changes until after a reload.
Sample Debugging Output for a working update.
*Aug 00 00:00:55.433 EDT: DYNDNSUPD: Adding DNS mapping for myhostname.no-ip.org <=> 18.104.22.168
*Aug 00 00:00:55.433 EDT: HTTPDNS: Update add called for myhostname.no-ip.org <=> 22.214.171.124
*Aug 00 00:00:55.433 EDT: HTTPDNSUPD: Session ID = 0x7
*Aug 00 00:00:55.433 EDT: HTTPDNSUPD: URL = ‘http://firstname.lastname@example.org:email@example.com/nic/update?hostname=myhostname.no-ip.org&myip=126.96.36.199’
*Aug 00 00:00:55.433 EDT: HTTPDNSUPD: Sending request
*Aug 00 00:00:56.441 EDT: HTTPDNSUPD: Response for update myhostname.no-ip.org <=> 188.8.131.52
*Aug 00 00:00:56.441 EDT: HTTPDNSUPD: DATA START nochg 184.108.40.206
*Aug 00 00:00:56.445 EDT: HTTPDNSUPD: DATA END, Status is Response data recieved, successfully
*Aug 00 00:00:56.445 EDT: HTTPDNSUPD: Call returned SUCCESS, update of myhostname.no-ip.org <=> 220.127.116.11 succeeded
*Aug 00 00:00:56.445 EDT: DYNDNSUPD: Another update completed (outstanding=0, total=0)
*Aug 00 00:00:56.445 EDT: HTTPDNSUPD: Clearing all session 7 info