If I'm getting what you're saying (I'm tired and very well may not be) this should do the trick:
http://ddclient.sourceforge.net/
Here is the thing. My ISP now intentionally changed the network setting once in a while ( like once a month ). They are not only changing IPs and stuff but they are changing the whole net blocks effectively rendering my box useless once that happen ( except outgoing traffic ). Since I run a mail server and web server for personal use, I can't use it remotely until I got home, manually restart my NIC and change IP in my DNS setting.
So is there any program ( or scripts ) that can do this?
1. Will check my server via ping or host. Then will get IP addy.
2. Will query local NIC interface with ifconfig command. Then extract the IP address info.
3. Will match the two.
4. If it's the same, then it will do nothing.
5. If the IPs are different or if the ping didn't return an IP, then will mail the notification to third party address ( such as to gmail account of mine ) so that I can update DNS info rather than on the remote location and finding out it's not working any longer.
6. Scripts of any language is acceptable since I won't be writing them. ;D
7. The script or program will be run from crontab once every 8 hours.
Can this be accomplished?
If I'm getting what you're saying (I'm tired and very well may not be) this should do the trick:
http://ddclient.sourceforge.net/
if ddclient is not what you are looking for it's fairly simple to write an application that does what you want in bash I did something similiar some time a go using grep and awk it's easy to grab the ip from ifconfig
Since your ips are changing... what is the dynamic dns server you are using?
I'm using DynDNS and I use WebDate-0.1 to do that for me.
Webdate-0.1: http://knowhow.garl.dyndns.org/webdate/
..
HTH
Okay, I will check out the ddclient.
The main reason I don't use dyndns service is that your domain name is always http://your-server.dyndns.com which I don't want.
I have my own domain name as http://www.my-domain.com and it's pointed to my IP address. But lately, my ISP had been doing crazy stuff ( it's a good thing the city is trying to negotiate a new cable provider and the California supreme court made decision last week that my ISP can't block the city's decision to negotiate deals with other providers for possible substitution ).
So I'm guessing it is easy to do a ping or host query, then do a local query of IP, match against the two and send out alert if it's not the same. I, as in non-programmer, knows nothing about how to go about it. :-[
Well no time like the present to learn...
Anyways, you could just make a bash script, which is just a series of shell commands to be executed.
[quote author=Compunuts link=board=9;threadid=9723;start=0#msg88379 date=1093582076]
Okay, I will check out the ddclient.
The main reason I don't use dyndns service is that your domain name is always http://your-server.dyndns.com which I don't want.
I have my own domain name as http://www.my-domain.com and it's pointed to my IP address. But lately, my ISP had been doing crazy stuff ( it's a good thing the city is trying to negotiate a new cable provider and the California supreme court made decision last week that my ISP can't block the city's decision to negotiate deals with other providers for possible substitution ).
So I'm guessing it is easy to do a ping or host query, then do a local query of IP, match against the two and send out alert if it's not the same. I, as in non-programmer, knows nothing about how to go about it. :-[
[/quote]
Try out http://www.zoneedit.com/. They allow DynDNS for those that have their own domains. As for IP address updating, you have several choices. If you want to write your own script, you can use http://cgi.internode.on.net/cgi-bin/showmyip?textonly=1 to get your current IP address and then use `dig +short <domain>` to check the IP address on the DNS records for your domain. Then compare those two and if they differ, update the DNS records. Here is a simple Perl script that may help you do what you want (you will need wget, dig, and lynx):
P.S. To all the Perl coders: feel free to critic/improve this script.Code:#!/usr/bin/perl -w use strict; # Complete the following variables my $ipaddr_file_location = ""; my $domain_name = ""; my $username = ""; my $password = ""; #No need to modify script following this line `wget --quiet -O $ipaddr_file_location http://cgi.internode.on.net/cgi-bin/showmyip?textonly=1`; my $dynaddr = `dig +short $domain_name`; my $newaddr = `cat $ipaddr_file_location`; chomp($dynaddr); chomp($newaddr); if ($dynaddr ne $newaddr) { `lynx -source -auth=$username:$password 'http://dynamic.zoneedit.com/auth/dynamic.html?host=$domain_name'`; } exit;
I'm not a Perl coder (actually, I prefer Python.) Nonetheless, the above is a little more succinct.Code:#!/usr/bin/perl -w use strict; # Complete the following variables my $domain_name = ""; my $username = ""; my $password = ""; #No need to modify script following this line my $dynaddr = `dig +short $domain_name`; my $newaddr = `wget --quiet -O - http://cgi.internode.on.net/cgi-bin/showmyip?textonly=1`; chomp($dynaddr); chomp($newaddr); if ($dynaddr ne $newaddr) { `lynx -source -auth=$username:$password 'http://dynamic.zoneedit.com/auth/dynamic.html?host=$domain_name'`; } exit;
[quote author=rhorn link=board=9;threadid=9723;start=0#msg88415 date=1093726489]
I'm not a Perl coder (actually, I prefer Python.) Nonetheless, the above is a little more succinct.
[/quote]
Cool, thanks! I was not sure on how to directly assign the output of wget to a variable. Karma++![]()
Bookmarks