Dynamic DNS setup with DNS2GO

Many locations have IP addresses that get changed frequently.  In order to be get remote access to your Oscar server, you need to install a Dynamic DNS client.  This can be on a workstation, router or server.  The workstation is probably easiest, but the workstation must always be on.  Router installation is good, but not supported by all routers.

I use DynDNS and DNS2GO. This post describes setting up the DNS2GO client on the Oscar Ubuntu server.  This was done for Ubuntu 12.04 and 13.10 servers.

Download Debian client from http://www.deerfield.net/download/dns2go/linux/index.htm and save in home folder.

For Ubuntu/Debian, use dns2go-2.0.tar.gz

Unzip file
tar -zxvf dns2go-2.0.tar.gz

Change to unzipped directory
cd dns2go-2.0

Check for location of libc library (see below)
find | grep libc.so.6

Install the DNS2GO client
sudo ./INSTALL.sh

Error – Could not find glibc library
Solution: change INSTALL.sh to check current location of libc library (see below)
for Ubuntu 13.10 /lib/x86_64-linux-gnu/libc.so.6

This will run the installer for the DNS2Go client and copy all necessary files to the correct locations. The executable is installed in /usr/local/bin, documentation in /usr/doc/dns2go-2.0, manual pages in /usr/local/man and conf file in /etc/dns2go.conf

To finish the installation, type:
sudo /usr/local/bin/dns2go

You will be asked if you want to create the dns2go.conf file, select Yes.
You will now be asked if for your domain name and registration key (if you do not have your key, do not run this yet).

eg. myclinic.dns2go.com

Add program ( /usr/local/bin/dns2go ) to /etc/rc.local to execute automatically when the server starts
sudo nano /etc/rc.local
/usr/local/bin/dns2go

Revised ~/dns2go-2.0/INSTALL.sh
#!/bin/sh
#
# Installation shell script, read INSTALL for details
#
echo " "
BINDEST=/usr/local/bin
DOCDEST=/usr/doc/dns2go-2.0
MANDEST=/usr/local/man
# select the architecture
case `uname` in
OpenBSD)
ARCH=OpenBSD
;;

FreeBSD)
ARCH=FreeBSD
;;

Linux)
ARCH=Linux
;;

*)
echo "Unrecognized version: Installing Linux binary"
ARCH=Linux
;;
esac

# If Linux, check for glibc library
if [ $ARCH = "Linux" ] ; then
if [ -f /lib/libc.so.5 ] ; then
ARCH=Linux/libc.so.5
elif [ -f /lib/i386-linux-gnu/libc.so.5 ] ; then
ARCH=Linux/libc.so.5
elif [ -f /lib/libc.so.6 ] ; then
ARCH=Linux/libc.so.6
elif [ -f /lib/i386-linux-gnu/libc.so.6 ] ; then
ARCH=Linux/libc.so.6
elif [ -f /lib/x86_64-linux-gnu/libc.so.6 ] ; then
ARCH=Linux/libc.so.6
else
echo "Error - Could not find glibc library";
exit -1;
fi
fi

echo " "
echo "Copying files..."

mkdir -p ${BINDEST} 2>/dev/null
cp ${ARCH}/dns2go ${BINDEST}/dns2go
chmod 755 ${BINDEST}/dns2go
mkdir -p ${MANDEST}/man1 2>/dev/null
cp dns2go.1 ${MANDEST}/man1
chmod 644 ${MANDEST}/man1/dns2go.1
mkdir -p ${MANDEST}/man5 2>/dev/null
cp dns2go.conf.5 ${MANDEST}/man5
chmod 644 ${MANDEST}/man5/dns2go.conf.5
mkdir -p ${DOCDEST} 2>/dev/null
cp README ${DOCDEST}
cp INSTALL ${DOCDEST}
cp LICENSE ${DOCDEST}
cp USAGE_POLICY ${DOCDEST}

echo " "
echo "DNS2Go unix client version 2.0 is installed"
echo " "
echo "The README is recommended for users upgrading from 1.x."
echo "Manual pages for dns2go and dns2go.conf are available."
echo "/usr/local/bin/dns2go -h is also useful."
echo " "
echo "Thanks for using DNS2Go from Deerfield.com"
echo " "