DynDNS

From OpenBSD-Wiki

Jump to: navigation, search
This article does not apply to any one particular OpenBSD version.

Contents

[edit] Overview

This page will tell you how to setup your OpenBSD machine to register it's IP address to the well known DynDNS service.

[edit] Version

This has been tested with OpenBSD 4.3. This has been tested with OpenBSD 4.5.

It may also work for other versions.

[edit] Install

[edit] Installing ipcheck

First thing you will need is the ipcheck python script. Luckelly this can be found in the openbsd packages.

pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/<version>/packages/<arch>/ipcheck

Where <version> is your OpenBSD version(ex: 4.5) and <arch> is your system architechture(ex: i386).

[edit] First run

The first time you run ipcheck.py, you need to use the --makedat argument. This will create some configuration file that ipcheck need to access when it is run. I suggest to place these file in /etc.

#cd /etc
#/usr/local/bin/ipcheck.py --makedat -i <if> <username> <password> <domains>

Where <if> is you network interface with the IP address you want to register(ex: pppoe0), <username>/<password> are your DynDNS account information and <domains> are a coma seperated list of domain to update(ex:domain1.dyndns.org,domain2.dyndns.org).

[edit] Creating a script file

Create a little script file that will simplify the DynDNS update.

#!/bin/sh
/usr/local/bin/ipcheck.py -q -d /etc -i <if> <username> <password> <domains>

Replace with you own information. Option -q will turn the quiet mode on.

Place this file in /usr/local/sbin/do_ipcheck and change it attribute to 500 and own by root. This file contain sensitive information and you don't want it to be read by anyone.

[edit] Add to crontab

By adding a simple line to the crontab, we will ensure that the IP address is always up to date. Simply add this to your cron table.

*/10     *       *       *       *      /usr/local/sbin/do_ipcheck

Of course the intervale time can be modified to suit your need.

Personal tools