Hi everyone
As a member of our library committee for the year 2009-2010, I was entrusted the task of helping out IT department in setting up a proxy for the purpose of filtering and regulating web traffic in our computer library. While I did not face any problem in setting up squid (non-transparent mode) on Ubuntu server 8.0.4.2 using the tutorials in ubuntugeek, I had hell on earth trying to get ddclient to work. This was compounded with the availability of incomplete documentation (?) on the opendns website, and conflicting examples in various fora. Hence this short tutorial
#To install packages for ssl communication in perl. This is required for authentication.
In the terminal type
sudo apt-get install libio-socket-ssl-perl
and press ENTER, press Y when prompted and press ENTER.
#Download ddclient
Download ddclient 3.8.0 from http://ddclient.sourceforge.net or from here
#Unpack the tarball
tar xvf ddclient-
and press TAB to auto complete. Press ENTER.
#Navigate to extracted folder
cd ddclient-
and press TAB to auto complete. Press ENTER.
#List contents
ls
and press ENTER. This is what you see
Changelog sample-etc_cron.d_ddclient
ChangeLog sample-etc_ddclient.conf
COPYING sample-etc_dhclient-exit-hooks
COPYRIGHT sample-etc_dhcpc_dhcpcd-eth0.exe
ddclient sample-etc_ppp_ip-up.local
README sample-etc_rc.d_init.d_ddclient
README.cisco sample-etc_rc.d_init.d_ddclient.lsb
README.ssl sample-etc_rc.d_init.d_ddclient.redhat
RELEASENOTE sample-etc_rc.d_init.d_ddclient.ubuntu
sample-ddclient-wrapper.sh TODO
#Copy the dd client executable to system binary folder
sudo cp ddclient /usr/sbin/
#Make required directories as root for further installation
sudo mkdir /etc/ddclient
sudo mkdir /var/cache/ddclient
#Copy the files to their destination
sudo cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf
#Editing the configuration file
sudo vi /etc/ddclient/ddclient.conf
Some of the changes you are going to make now are optional.
Daemon updates ip every 300 seconds. Change value if desired.
daemon=300
Commenting out by adding # in front of
mail=root
mail-failure=root
if you do not want any messages. This is optional.
Uncomment the line by deleting the # sign at the begining of the line
#use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address
so that it looks like
use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address
Uncomment this line
#protocol=dyndns2
so that it looks like this
protocol=dyndns2
Uncomment and edit the server name
#server=members.dyndns.org # default server
so that it looks as follows
server=updates.opendns.com # default server
Uncomment and insert your username and password here
#login=your-login # default login
#password=test # default password
For example, if your username is alfred and your password is hitchcock, these lines will look as follows
login=alfred # default login
password=hitchcock # default password
Create an empty line immediately after this line and type the network label of your opendns network. For example my network label is home, so I simply type, in a new line
home
Save changes in the editor and exit.
# Copying the init script:
sudo cp sample-etc_rc.d_init.d_ddclient.lsb /etc/init.d/ddclient
#Edit startup script. In the official documentation, this step is not mentioned. If you open the above script as follows
sudo vi /etc/init.d/ddclient
you will see this line
start_daemon $DDCLIENT_BIN -daemon 300
a command for the daemon to update every 300 seconds. If you change this value in the ddclient.conf, then there will be a conflict. My experience is that the time mentioned here is followed, and not what is in the ddclient.conf ! So if you changed the time when editing the ddclient.conf file (it's the first change listed above in that file), then make the same change here too. For example if you changed 300 to 900 in the ddclient.conf file, change the 300 to 900 here too.
## enable automatic startup when booting
sudo update-rc.d ddclient defaults
# start the first time by hand
sudo /etc/init.d/ddclient start
#Check for running process
ps aux | grep ddclient
and press ENTER
You will see something like this
root 2989 0.0 0.4 6372 4288 ? S 23:14 0:00 ddclient - sleeping for 420 seconds
neville 5828 0.0 0.0 3340 788 pts/0 S+ 23:22 0:00 grep ddclient
and check if your ip is getting updated in the dashboard of your opendns account. The first and subsequent updates take place after the time delay you specified above. For example if you left it at default (300), then it is only 300 seconds after you boot up that your IP gets updated. So don't be surprised if your IP is not updated "immediately", as soon as the boot process is complete
Bookmarks