Getting a Hostname to work on a home Dynamic IP system

Registering with DynDNS

The first step in giving my server a web-wide recognisable presence given that the ISP allocates the router a Dynamic IP is to register for a free account at DynDNS. This I do and once configured I should be able to reach my Apache website at http://sylvarwolf.homelinux.com. Cool, huh?

Command Shell on Webmin

Back on the server, I type in:

apt-get install ipcheck

Then click on Others>File Manager and navigate to /etc/ppp/ip-up.d/. I create a new file in this directory by clicking New and name it dyndns_update in the requester that pops up. Then paste in the following code:

 	#!/bin/sh

 	USERNAME=myusername
	PASSWORD=mypassword
	HOSTNAME=myhostname.dyndns.org

 	cd /root/
	if [ -f /root/ipcheck.dat ]; then
		ipcheck -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME
	else
		ipcheck --makedat -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME
	fi

replacing “myusername” and “mypassword” with my unique username and password. Also, replace the HOSTNAME field to the domain I have chosen, i.e. sylvarwolf.homelinux.com.

Then back to the Server’s CLI, and I type

chmod 700 /etc/ppp/ip-up.d/dyndns_update
sh /etc/ppp/ip-up.d/dyndns_update

This returned ‘update successful’ for me – more good stuff. Then

apt-get install ddclient

The only confusing thing that the install asked me was for the interface that would be used. I guessed that it would be the NIC that my 
internet connection was on, so I chose eth0.

Testing the URL

Testing is simple, just type http://sylvarwolf.homelinux.com into my browser and wait. It returns a very boring webpage but one that comes from my server. So Apache is working as well. Yay! All done.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s