| Category: | Web stuff |
| Author/Contact Info | Ryan Whitworth lithron@gmail.com |
| Description: | A "smart" client that will update your Dyndns.org (or other domain from the company) to your current IP address. Works from behind a NAT (via www.whatismyip.com). Only tested under Win32 with Cygnus' Cygwin tools installed. Requires LWP::Simple and Socket. |
Updated : removed the call to nslookup thanks to code provided by TheFluffyOne
#!/usr/bin/perl -w
use strict;
use warnings;
use LWP::Simple;
use Socket;
my $login = 'test';
my $password = 'test';
my $domain = 'test.mine.nu';
my $mx = 'mail.test.mine.nu';
my $ipaddress = LWP::Simple::get("http://www.whatismyip.com");
if ($ipaddress =~ /([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/)
{
$ipaddress = $1;
}
my $nslookup = "0.0.0.0";
if ($nslookup = gethostbyname($mx)) {
$nslookup = inet_ntoa($nslookup);
} else {
print "Could not resolve domain name, check $domain is correct\n";
print "Going to try to update information for $domain anyway ...\n";
}
if ($ipaddress eq $nslookup) {
print "Nothing to update. Current IP ($nslookup)";
print " = DNS address ($ipaddress)\n";
exit(0);
}
print "Updating the IP address ($ipaddress) now ... \n";
my $response = LWP::Simple::get("http://$login:$password\@" .
"members.dyndns.org/nic/update?system=dyndns&hostname=$domain" .
"&myip=$ipaddress&wildcard=ON&mx=$mx&backmx=NO&offline=NO");
print "Status : $response\n";
|
|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dyndns.org Updating Client
by allolex (Curate) on Nov 24, 2003 at 00:58 UTC | |
by Aristotle (Chancellor) on Nov 26, 2003 at 11:46 UTC | |
|
Re: Dyndns.org Updating Client
by b10m (Vicar) on Nov 23, 2003 at 23:27 UTC | |
by lithron (Chaplain) on Nov 24, 2003 at 20:31 UTC | |
by b10m (Vicar) on Nov 24, 2003 at 20:51 UTC | |
|
Re: Dyndns.org Updating Client
by TheFluffyOne (Beadle) on Nov 24, 2003 at 19:42 UTC | |
by lithron (Chaplain) on Nov 24, 2003 at 20:29 UTC |