Dynamic DNS Updater

From Baranoski.ca
Jump to navigation Jump to search

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. It allows you to manually set the HTTP/1.1 virtual host, and it allows for passwords over 15 characters.

Generate The Authorization Key

  1. Go to http://www.base64encode.org/.
  2. Enter your username and password in the format username:password with no spaces
  3. Click the Encode button.
  4. 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. If you're not using EasyDNS, replace the api.cp.easydns.com and /dyn/tomato.php with the appropriate values for your provider.

ip sla 1
 http raw http://api.cp.easydns.com
  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
 frequency 3600
ip sla schedule 1 life forever start-time now