Koozali.org: home of the SME Server

dns2go question

Sidney

dns2go question
« on: August 29, 2001, 05:24:44 PM »
hello,
 how do you setup dns2go client on es 4.1.2 ?



thanks

Scott Smith

dns2go Mini-HOWTO (was: dns2go question)
« Reply #1 on: August 29, 2001, 06:57:20 PM »
Mini-HOWTO: DNS2GO Dynamic DNS Service


Author: J. Scott Smith
Release: 0.1.0 29-AUG-2001
Platform: e-smith 4.1.2


This explains how to setup DNS2GO (http://www.dns2go.com) to work with e-smith. It uses a custom template to build the /etc/dns2go.conf file, which allows it to hook in with the e-smith db files. It also creates a quick and dirty link in /etc/rc7.d to make sure DNS2GO starts when the system is rebooted.

Somebody may want to take this and make it 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.


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.


2. Modify the /sbin/e-smith/dynamic-dns/custom file. Rather than overwrite the original custom script, I recommend you copy it to custom-skeleton. Then rename custom to dns2go. 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 restart the dns2go daemon process

/sbin/e-smith/expand-template /etc/dns2go.conf

/usr/local/bin/dns2go -r

#------------------------------------------------------------
# Your handler ends here.
#------------------------------------------------------------

exit 0

#EOF(custom)


3. 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 /etc/rc.d/rc7.d/S99dns2go


4.Create the file  /etc/e-smith/templates-custom/etc/dns2go.conf by copying the /etc/dns2go.conf file (installed in step 1) and changing it 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: 8)
#retries = 8

# 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.)


5. 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, emailed to you when you signed up for the service, as the DNS password. Remember that the key is case sensitive.

Complete the console setup and reboot the server.


6. To complete the installation, simply test your domain. Network-Tools (http://network-tools.com) is one place you can go to test connectivity to 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".


The End.

Alejandro

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #2 on: August 29, 2001, 09:10:56 PM »
Sidney:
I have it working for 4 or 5 months without any troubles, feel free to ask what you need.
An important thing is to uncomment and set "retries" variable in dns2go.conf file to -1 value in order to never give up connection attemps, is is very usefull in case you have a not veri reliable pppoe/adsl link with your isp and your connection is lost often, of course on weekends when you are not there to restart dns2go script.
 


# number of connection attempts (optional, default: 8)
#retries = 8
should be
retries = -1

Alejandro

Scott Smith

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #3 on: August 29, 2001, 09:16:21 PM »
Alejandro wrote:
> An important thing is to uncomment and set "retries" variable
> in dns2go.conf file to -1 value in order to never give up
> connection attemps...

I'll make a note of that for the HOWTO. I've not had a problem, but I've got a pretty stable and reliable connection.

Thanks

Scott

Sidney

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #4 on: August 29, 2001, 10:34:50 PM »
Thank you

Sidney

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #5 on: August 30, 2001, 12:14:50 AM »
hello,

I have ran into some errors. could you help me.
here is what I done so far.
I copy the custom file and name it dns2go under the

1. /sbin/e-smith/dynamic-dns/

2. made changes to the dns2go file with step 2 on the instruction

3. when trying #3 I get a message file exists

4. when trying #4 I get no such file or directory

I have already install the rpm and ran the dns2go it ask me for the key and domain name.
do I need to start over and remore the rpm and not configure the dns2go.conf?

thanks

Sidney

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #6 on: August 30, 2001, 12:15:35 AM »
hello,

I have ran into some errors. could you help me.
here is what I done so far.
I copy the custom file and name it dns2go under the

1. /sbin/e-smith/dynamic-dns/

2. made changes to the dns2go file with step 2 on the instruction

3. when trying #3 I get a message file exists

4. when trying #4 I get no such file or directory

I have already install the rpm and ran the dns2go it ask me for the key and domain name.
do I need to start over and remore the rpm and not configure the dns2go.conf?

Is there an rpm for this ?

thanks

Scott Smith

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #7 on: August 30, 2001, 01:04:26 AM »
You needed to copy the default custom file to custom-skeleton and then rename custom to dns2go. (Note: the DYNDNS var is used just to make the command lines shorter.)

     # DYNDNS=/sbin/e-smith/dynamic-dns
     # cp $DYNDNS/custom $DYNDNS/custom-skeleton
     # mv $DYNDNS/custom $DYNDNS/dns2go

Then perform the edits. Sounds like that wasn't exactly what you did.


> I copy the custom file and name it dns2go under the
>
> 1. /sbin/e-smith/dynamic-dns/
>
> 2. made changes to the dns2go file with step 2 on the instruction
>
> 3. when trying #3 I get a message file exists

If I understand correctly, you currently have files 'custom' and 'dns2go' in the $DYNDNS directory. If so, the following should work:

     # mv $DYNDNS/custom $DYNDNS/custom-skeleton

That should allow you to do the first ln (of dns2go to custom) under step 3. I'm assuming the second ln (of dns2go to S99dns20) worked.

> 4. when trying #4 I get no such file or directory

You may need to create the directory under templates-custom first.

     # mkdir -p /etc/e-smith/templates-custom/etc

Then copy the file, etc.

> I have already install the rpm and ran the dns2go it ask me
> for the key and
> domain name.
> do I need to start over and remore the rpm and not configure
> the dns2go.conf?

No.

> Is there an rpm for this ?

No.

Scott

Scott Smith

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #8 on: August 30, 2001, 01:15:46 AM »
Sidney,

I also see that the second ln command in step 3 was missing the filename in the source path.

I will post an updated version in a few minutes.

Scott

Scott Smith

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #9 on: August 30, 2001, 01:21:34 AM »
Mini-HOWTO: DNS2GO Dynamic DNS Service
----------------------------------------------------------------------

Author   : J. Scott Smith
Version  : 0.1.2
Release  : 29-AUG-2001
Platform : e-smith 4.1.2


INTRODUCTION
----------------------------------------------------------------------

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 restart the dns2go daemon process

/sbin/e-smith/expand-template /etc/dns2go.conf

/usr/local/bin/dns2go -r

#------------------------------------------------------------
# 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: 8)
# 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!

Sidney

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #10 on: August 30, 2001, 02:14:18 AM »
Scott,

On the first instruction #2 you wanted to copy the custom file to custom-skeleton the rename custom to dns2go.

At first I did understand custom-skeleton ment.

I understand now from you second instruction
that you wanted to make a copy of the custom file and save it as
custom-skeleton. then rename the custom file to dns2go.

Is this right ?

I get to the #3  and I get no file exists
when I type this command all in one line
"ln -s /sbin/e-smith/dynamic-dns/dns2go /sbin/e-smith/dynamic-dns/custom"

with out the "


what am I doing wrong ?

Sidney

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #11 on: August 30, 2001, 02:27:18 AM »
Let me make a correction on my last post.

On #3 I get file exists.


sorry

sidney

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #12 on: August 30, 2001, 07:14:21 AM »
Scott,

    I got it to work ! thanks for all your help.

I have one more question.
how can you tell if the dns2go is running?
I guess you called it a deamon?


Thanks again

Alejandro

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #13 on: August 30, 2001, 05:59:41 PM »
In the standard installation dns2go will report result of heartbeats to \var\log\messages file
there is another file showing dns2go current status and is stored in \var\dns2go\status.dat
if you change default installation setting during first use dns2go, or you  redirected the log file in the dns2go.conf file the log should be stored at \root
a really god test to see if all is working wright could be sending an e-mail to yourself from a web based e-mail account like hotmail or similar and wait a few minutes to see if it reachs destination.
Alejandro

Scott Smith

Re: dns2go Mini-HOWTO (was: dns2go question)
« Reply #14 on: August 30, 2001, 07:40:24 PM »
sidney wrote:
>     I got it to work ! thanks for all your help.

You're welcome. Thanks for finding the bugs in the doc ;-)

> I have one more question.
> how can you tell if the dns2go is running?

Just to see if the daemon is running?

ps -ef | grep dns2go

To see if you are connected, check the control center at www.dns2go.com. It will tell you if your domain(s) are online or offline. I don't know if the Linux client can tell you that info or not -- I've not looked for that particular feature.

Scott