Skip to Content
Author's profile photo Former Member

Using Dynamic DNS with Amazon EC2 and HANA Development Edition

I’ve used Dynamic DNS with my Windows instances on Amazon EC2 for a while.

With the introduction of the HANA Development Edition, I was keen to also be able to use one common DNS name for any IP of my HANA instance on startup. Especially when creating demo clustered environments of 2-3 EC2 instances (HANA, BusinessObjects BI4, and Data Services), if all the instances can talk to each other straight away on startup (and your client tools on your laptop as well), it cuts down config time whether you presenting to a customer or wanting to start developing straight away.

Some of you may use Elastic IPs, I have found these to be a little tedious in creation and application, and apparently you are also charged for them when your instances aren’t running (which is most of the time for most devs). The solution presented in the video is an alternative to this approach. Please also note that this solution really applies to any Linux system, not just Amazon EC2 and/or HANA.

The detail presented in the video (available in HD so you can see the command line!) below will follow. Enjoy:

Here is the complete script:

#!/bin/sh
### BEGIN INIT INFO
# Provides:       dyndns
# Required-Start: $network $remote_fs $syslog
# Required-Stop:  $null
# Default-Start:  3 4 5
# Default-Stop:   0 1 6
# Description:    Update Dyndns
# Short-Description: Update Dyndns
### END INIT INFO
. /etc/rc.status
rc_reset
USER="<USER>"
PASS="<SECRET PASSWORD>"
DOMAIN="<DYNAMIC DNS NAME>"
case "$1" in
     start)
          wget -O /dev/null http://$USER:$PASS@members.dyndns.org/nic/update?hostname=$DOMAIN
          rc_status -v
          ;;
esac
rc_exit

The commands I executed in the video above:

  1. cd /etc/init.d/
  2. vi dyndns (paste script in here)
  3. chmod u+x dyndns
  4. chkconfig -a dyndns
  5. service dyndns start
  6. sudo ln -s /etc/init.d/dyndns /etc/init.d/rc5.d/S99dyndns

Lastly, if you aren’t familiar with opening an SSH connection to your HANA Development Edition, the steps to do so are posted in this SCN post (refer to Step 5).

I hope you enjoy this video, and welcome any feedback or questions.

(You can see more videos from DSLayer.net over at YouTube)

UPDATE 1 – fix two code issues (15/08/2013)

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hay Joshua Fletcher

      Great post as always... a few small typos I picked up while setting up DynDns on my HANA instance.

      1. In the sample text file I think you mistakingly "double pasted" some of the URL. Should read like this: wget -O /dev/null http://$USER:$PASS@members.dyndns.org/nic/update?hostname=$DOMAIN
      2. There was a double service in point 5 but I see you spotted that as well. 😉
      3. Finally for those clueless with Vi and the Linux world
        1. When you do Step 2 you are creating a new file and are in Edit Mode
        2. Do exit edit mode simple press the ESC key
        3. To save the file then type :wq!: followed by the Return key

      Thanks again for taking the time to put this together as I have always wanted to set this up but never found time.

      Now my HANA server is DynDns'd so thanks ! 😎

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thanks for the feedback Clint, much appreciated.

      Glad it could help you out.

      Josh