Difference between revisions of "Dynamic DNS Updater"

From Baranoski.ca
Jump to navigation Jump to search
Line 7: Line 7:
  
 
==The Solution==
 
==The Solution==
Use Cisco's IP SLA functionality to generate the proper request.  This will periodically request the update page, at the specified frequency, which will update the specified hostname.
+
Use Cisco's IP SLA functionality to generate the proper request.  This will periodically request the update page, at the specified frequency, which will update the specified hostname. If you're not using EasyDNS, replace the '''api.cp.easydns.com''' and '''/dyn/tomato.php''' with the appropriate values for your provider.
 +
 
  
 
===Generate The Authorization Key===
 
===Generate The Authorization Key===
 
Go to http://www.base64encode.org/, enter '''username:password''' and click the Encode button.  Copy the whole thing, including the trailing = sign.  The result is used below.
 
Go to http://www.base64encode.org/, enter '''username:password''' and click the Encode button.  Copy the whole thing, including the trailing = sign.  The result is used below.
 +
  
 
===Create The IP SLA Policy===
 
===Create The IP SLA Policy===
 +
Replace '''dyn.example.ca''' with your hostname.  Replace '''dXNlcm5hbWU6cGFzc3dvcmQ=''' with the key generated above.
 +
 
<PRE style="color:white;background-color:black;font-weight:bold;font-size:1.2em;">
 
<PRE style="color:white;background-color:black;font-weight:bold;font-size:1.2em;">
 
ip sla 1
 
ip sla 1

Revision as of 13:37, 13 June 2013

The Problem

The Cisco implementation for Dynamic DNS updating is broken in two ways that I've found:

  • Firstly, there's Cisco Bug ID CSCtx50249, which truncates the password in the URL to 15 characters. DynDNS providers that generate a key for your domain seem to prefer 16 characters.
  • On the 830-series of routers, the DynDNS updater does not do HTTP/1.1 requests to the server, but instead an HTTP/1.0 request. This is a problem with EasyDNS, as their update server is on a virtual host, which requires an HTTP/1.1 request in order to present the user with the correct website. This doesn't appear to be an issue on the 1800 or 870-series.


The Solution

Use Cisco's IP SLA functionality to generate the proper request. This will periodically request the update page, at the specified frequency, which will update the specified hostname. If you're not using EasyDNS, replace the api.cp.easydns.com and /dyn/tomato.php with the appropriate values for your provider.


Generate The Authorization Key

Go to http://www.base64encode.org/, enter username:password and click the Encode button. Copy the whole thing, including the trailing = sign. The result is used below.


Create The IP SLA Policy

Replace dyn.example.ca with your hostname. Replace dXNlcm5hbWU6cGFzc3dvcmQ= with the key generated above.

ip sla 1
 http raw http://api.cp.easydns.com
 http-raw-request
  GET /dyn/tomato.php?hostname=dyn.example.ca HTTP/1.1\r\n
  Host: api.cp.easydns.com\r\n
  Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=\r\n
  \r\n
  end
  exit
 frequency 3600
ip sla schedule 1 life forever start-time now