PDA

View Full Version : DNS client update IP thru cron or other?


domino
17th August 2005, 01:30
I've search here and didn't find any hit that pertains to my question. So i'm sorry if this has been covered. I know this should be posted in the proper site, but I figured this post can be useful to other n00bs like myself.

How do I add the fallowing to cron every 15min?

wget -O - --http-user=username --http-passwd=password "https://dynamic.zoneedit.com/auth/dynamic.html?host=domain.com"

I have webmin installed and I am in the cron section. I'm guessing I paste the code above in the "Input to command" box. But what do I type in the "Command" box? Should I run this job as root? What if I need to update 3 other domains? Do I create 3 other cron jobs?

Can anyone recomend a n00b friendly DNS client with gui? What about ez-ipupdate? I have the RPM version for RedHat, but will it work properly with Fedora?

Greets!

falko
17th August 2005, 12:01
You can run

crontab -e to edit your cronjobs. There you enter

*/15 * * * * wget -O - --http-user=username --http-passwd=password "https://dynamic.zoneedit.com/auth/dynamic.html?host=domain.com"
and save the file.

Should I run this job as root? At least you won't have any permissions problem then... :p If you know the cron job is working and doesn't destroy anything, then you can run it as root.

What if I need to update 3 other domains? Do I create 3 other cron jobs?

Yes.

till
17th August 2005, 12:03
I've search here and didn't find any hit that pertains to my question. So i'm sorry if this has been covered. I know this should be posted in the proper site, but I figured this post can be useful to other n00bs like myself.

How do I add the fallowing to cron every 15min?

wget -O - --http-user=username --http-passwd=password "https://dynamic.zoneedit.com/auth/dynamic.html?host=domain.com"

I have webmin installed and I am in the cron section. I'm guessing I paste the code above in the "Input to command" box. But what do I type in the "Command" box? Should I run this job as root? What if I need to update 3 other domains? Do I create 3 other cron jobs?

Can anyone recomend a n00b friendly DNS client with gui? What about ez-ipupdate? I have the RPM version for RedHat, but will it work properly with Fedora?

Greets!

I would solve it like this:

1) Write a small shell script that contains the code for the zoneupdates, lets call it zoneupdate.sh, we store it for example in the /root folder.

Contents of /root/zoneupdate.sh

#!/bin/bash

wget -O - --http-user=username --http-passwd=password "https://dynamic.zoneedit.com/auth/dynamic.html?host=domain.com"

In this shellscript you can add a line for each domain.

To make the script executable, run this comand:

chmod +x /root/zoneupdate.sh

Now we add the cronjob. Run this command on the shell as root user to open the root crontab in an editor:

crontab -e

Then we insert this line at the end and save the file:

0,15,30,45 * * * * /root/zoneupdate.sh &> /dev/null

(This is untested and may contain errors :D )

domino
17th August 2005, 12:41
Hmm, I had wanted to do the cron job at first. Then I read about the script but couldn't understand it until till explained it. Since I will be adding 5 of my own domains, and a handfull of hosted subdomains from dynDNS, I think the script will be the best way to go. As long as there are no errors :P. Will post back the results.

Thank you both!!

domino
18th August 2005, 03:04
Ok, I read that running a cron job for 10 domains every 15min. on the same DNS server was not a very nice thing to do to a free DNS service, so no cron :(. I tried the script that till mentioned and when I tried to run the script manually, the script froze :(.

I looked and search for half the day. Then finally ran accross ddclient-3.6.6. It says anyone with brains can run and install it, so I guess I must lack brains because it took me another 4hrs to get it installed and running. Well, I think I have it running as I don't know if my ISP changed my IP the last 24hrs. I will now in the next 2 days though.

domino
18th August 2005, 06:16
I feel like kicking myself in the ass for not thinking about this. I guees the exicement of running everything in linux caught me offgaurd. Anyway sorry for making this my personal blog thread :p. So here it goes.

I ran win/apache + DynSite client before I installed VMWare and Fedora as a guest OS. I removed apache for win32 but kept DynSite installed. When trying to clean the system and deciding whether or not to remove DynSite, it suddenly occured to me that I can still use DynSite to update my IP! Since Fedora and Widnows + DynSite are on the same network, the AP/Router will take care of the site requests.

So there it is! A newbie guide to updating your Dynamic IP. If you have a windows unit set up on your network, installing a DNS client on it will reduce the headaches. I would like to add that linux has 1 less thing to run every 3 minutes. :cool: