my ISP is changing my IP address once a day, but still i wanted to connect to my raspberry pi homeserver from the internet. After some experimentation time i found a nice solution to work with.
1.) Register and setup spdns
Register as a new user at spdns.de
Setup a new virtual hostname for example “myhost.spdns.eu”
2.) setup a little python script
I downloaded a script from the user “mmichaa” python_script
and altered the main function of the script
if len(argv) != 4:
print "tUSAGE: " + __file__ + ' <hostname> <user> <passwd>'
hostname = argv
user = argv
passwd = argv
hostname = 'myhost.spdns.eu'
user = 'myusername'
passwd = 'mypassword'
so you do not need to provide the username and password as command line parameters.
3.) setup a cron job to automatically start the script
alter the cron configuration by entering
sudo crontab -e
add a new line at the end of the document
@hourly python /home/pi/spdns-client.py
test the script
sudo /etc/init.d/cron restart