Mini-HOWTO: DNS2GO Dynamic DNS Service
----------------------------------------------------------------------
Author : J. Scott Smith
Version : 0.1.3
Release : 30-AUG-2001
Platform : e-smith 4.1.2
Requires : DNS2Go Linux Client 1.1
Links to :
http://www.e-smith.com http://www.dns2go.com http://network-tools.comINTRODUCTION
----------------------------------------------------------------------
This document explains how to setup the DNS2GO (
http://www.dns2go.com)
to work with e-smith. It uses an e-smith custom template to build the
/etc/dns2go.conf file, which allows it to hook into the e-smith db
files. It also creates a quick and dirty dirty link in /etc/rc7.d to
make sure DNS2GO starts when the system is rebooted.
Somebody may want to make this into an RPM. Please do!
Please direct comments and questions regarding this HOWTO to one of
the e-smith (now Mitel Network Server Solutions Group) forums or
mailing lists.
INSTALLATION
----------------------------------------------------------------------
>>>>> Step 1 <<<<<
Register your domain with DNS2GO, then download and install the DNS2GO
Linux client per the instructions from their site. Do not bother with
their configuration instructions, though, just install the package.
>>>>> Step 2 <<<<<
Prepare the /sbin/e-smith/dynamic-dns directory.
# cd /sbin/e-smith/dynamic-dns
# cp custom custom-skeleton
# mv custom dns2go
>>>>> Step 3 <<<<<
Modify the dns2go file as follows:
#!/bin/sh
# Description: DNS2GO by Deerfield
#------------------------------------------------------------
# Custom dynamic DNS update handler.
#------------------------------------------------------------
# note - these are not used by DNS2GO
IPADDR=$1
USERID=$2
PASSWD=$3
DOMAIN=$4
#------------------------------------------------------------
# Your handler starts here.
#------------------------------------------------------------
# expand /etc/dns2go.conf custom template and
# start/stop/restart the dns2go daemon process
/sbin/e-smith/expand-template /etc/dns2go.conf
DNS2GO=/usr/local/bin/dns2go
STATUS=offline
grep "^pid = 0" /var/dns2go/status.dat >/dev/null 2>&1 || STATUS=online
case "$1" in
start) if [ $STATUS = offline ]
then
$DNS2GO
else
$DNS2GO -r
fi
;;
stop) if [ $STATUS = online ]
then
$DNS2GO -k
else
echo "DNS2Go by Deerfield.com is already stopped"
fi
;;
restart) if [ $STATUS = online ]
then
$DNS2GO -r
else
$DNS2GO
fi
;;
*) $DNS2GO $@ ;;
esac
#------------------------------------------------------------
# Your handler ends here.
#------------------------------------------------------------
exit 0
#EOF(custom)
>>>>> Step 4 <<<<<
Link the above custom script to 'custom' and into run level 7. This
next command will link the 'dns2go' script created above to the
'custom' name, which is what e-smith will be looking for. The script
will be run by various e-smith events as necessary.
# ln -s /sbin/e-smith/dynamic-dns/dns2go /sbin/e-smith/dynamic-dns/custom
And the next command will link the dns2go script into run level 7 so
the DNS2GO daemon will start when the system boots:
# ln -s /sbin/e-smith/dynamic-dns/dns2go /etc/rc.d/rc7.d/S99dns2go
>>>>> Step 5 <<<<<
Create the file /etc/e-smith/templates-custom/etc/dns2go.conf by
copying the /etc/dns2go.conf file, which was installed in step 1. It
may be necessary to create the directory first, using the command:
# mkdir -p /etc/e-smith/templates-custom/etc
Once/If the directory is created, copy the file using:
# cp /etc/dns2go.conf /etc/e-smith/templates-custom/etc
>>>>> Step 6 <<<<<
Edit the file to match the one shown below. I've marked the changed
areas with "# MOD: e-smith" (except for the header and footer comments
-- those are kinda obvious!)
#------------------------------------------------------------
# DO NOT MODIFY THIS FILE! It is updated automatically by the
# e-smith server and gateway software. Instead, modify the source
# template in the /etc/e-smith/templates directory. For more
# information, see
http://www.e-smith.org.
#
# copyright (C) 1999, 2000 e-smith, inc.
#------------------------------------------------------------
#
# Simple configuration file for DNS2Go linux client
#
# For more information refer to the dns2go.conf manual page
#
# GLOBAL DIRECTIVES
#
# DNS2Go Server
server = discovery.dns2go.com
# Key (required, case-sensitive)
# MOD: e-smith
key = {$DynDnsPassword}
# log file (optional, default: syslog)
# MOD: e-smith
log = /var/log/dns2go
# number of connection attempts (optional, default:
# MOD: e-smith
# -1: never give up, retry forever
retries = -1
# rate to send heartbeats (in minutes) (optional, default: 0=automatic)
#heartbeat-rate = 0
#
# DOMAIN DIRECTIVES
#
# Fully qualified domain name (required)
# MOD: e-smith
domain = {$DynDnsAccount}
# static IP address (optional, default: external IP address)
#address=0.0.0.0
# online www alias redirection: choose one of the following:
# (optional, default: www alias resolves to domain IP)
#www-redirect-url = http://...
#www-redirect-port = 8080
# offline redirect option: choose one of the following
# (optional, default: offline status page)
#offline-url = http://...
#offline-ip = 0.0.0.0
#------------------------------------------------------------
# TEMPLATE END
#------------------------------------------------------------
You may also want to change some of the other settings such as the
online/offline www alias redirection, etc. Please see the DNS2GO
documentation and/or web site for details about other settings. For
our purposes, though, we are only concerned with the DNS2GO domain and
key (which, as you may have guessed, we are mapping to the e-smith
DynDnsAccount and DynDnsPassword entries.)
Thanks to Alejandro for the tip on the retries option. By setting this
value to -1, the dns2go daemon is instructed to retry forever (ie,
never give up trying) to reconnect to the DNS2GO service. This is
useful if you have an unreliable connection (pppoe, adsl, cable, etc.)
>>>>> Step 7 <<<<<
Use the console interface to configure Dynamic DNS. Select the
"custom" option. You just created the script for this type of dyndns
service in step 2 above.
Enter the name of your DNS2GO domain as the DNS account. For example,
if your domain is "johndoe.dns2go.com" then enter this. If you are
hosting a primary domain, such as mydomain.com, with DNS2GO then enter
that domain here. Do not include prefixes such as www.
Enter the DNS2GO key, which was emailed to you when you signed up for
the service, as the DNS password. Remember that the key is case
sensitive and must be entered exactly as it was sent to you.
Complete the console setup and reboot the server.
>>>>> Step 8 <<<<<
To complete the installation, simply test your domain. (Unsolicited
plug: I use the Network-Tools (
http://network-tools.com) site for this
type of thing, which makes it easy to check out your (or any) system.)
Run a ping test to your domain, for example "johndoe.dns2go.com", and
also to your www alias, such as "
www.johndoe.dns2go.com".
CONCLUSION
----------------------------------------------------------------------
DNS2GO is a nice service in that their daemon takes care of the
details of figuring out the IP address, contacting the DNS host, etc.
In fact, you can run DNS2GO without taking all the steps outlined
above. You could just do this:
1. Install and configure DNS2GO.
2. Add this command to /etc/rc.local: /usr/local/bin/dns2go -r
That will force the daemon to start when the system is booted, which
takes care of the rest of the details. But, having the integration
with the templates is nice as it ensures the daemon is restarted
whenever e-smith makes changes that might affect DNS.
BTW, one of the nice features of DNS2GO is the way it handles multiple
domains. Say for instance that you have setup "domain1.d2g.com" and
"domain2.d2g.com". Using the DNS2GO control center, you can specify
these domains to be grouped. Now, when the dns2go daemon updates any
one domain in the group, all of the others are updated. Very nice!
WISH LIST
----------------------------------------------------------------------
The Dynamic DNS support in e-smith needs to be modularized. This would
make it easier (IMHO) to add/modify dyndns providers to the system.
Each provider could have their own set of options, so for example the
DNS2GO module could provide fields for the retries, online/offline web
aliasing, etc.
Someday
THE END
----------------------------------------------------------------------
Uh-hum. I already told you, this is the end!