有两种方案: 1. 使用科迈的comexe.cn免费DDNS; 2. 使用Zoneedit的DDNS
1. 使用comexe.cn
注册帐号在COMEXE.CN,然后下载for,FREEBSD的软件
解压,配置,有参考文档http://comexe.cn/ddns_assistant_use.php#a4
最后执行
echo 'nohup /usr/local/comexe/pipclient -w /usr/local/comexe &' >>/etc/rc.local
这样就完成了
科迈的客户端有一个特点,就是能够在ADSL路由内的共享上网环境中使用,这一点非常难得啊。
当然,ADSL路由必须打开DMZ功能。
2. 使用Zoneedit的DDNS
注册帐号在zoneedit.com
然后运行客户端软件,但是这个客户端软件对在ADSL路由内的共享上网环境不支持,也就是说他的客户端只能在路由器上使用,后来我做了修改,能用了,zoneedit.pl
###################
##
## ZoneEdit.Com Dynamic IP script
## v0.9
##
###################
use Sys::Hostname;
use LWP::UserAgent;
#### README: change these to match the zones you want
#### TODO: put these in a configuration file, and prompt the user for them the first time he runs it
$zones = 'domainname';
$pass = '**********';
$login = 'username';
#### README: (optional) change these to a directory where you want them to be... ie: /var/log or c:/temp
$logfile = '/usr/zoneedit/ze-ip.log';
$ipfile = '/usr/zoneedit/ze-ip.txt';
#clear the logfile
clear();
mark("START",100,"Starting dynamic IP program");
while (1) {
#read the previous ip address
open S, "$ipfile";
$prev_ip = <S>;
close S;
#get the current ip address
system("fetch http://dynamic.Zoneedit.com/checkip.html");
sleep(10);
system("cat ./checkip.html|grep /'[0-9]//{3//}.*/'|cut -d: -f2 >./ip.new");
open S,"ip.new";
$ip = <S>;
close S;
mark($ip,100,"hello");
if (!($ip eq $prev_ip)) {
#report the current ip address to zoneedit.com
$ua = new LWP::UserAgent;
$ua->credentials('dynamic.zoneedit.com:80', 'DNS Access', $login, $pass);
$request = new HTTP::Request('GET', "http://dynamic.zoneedit.com/auth/dynamic.html?zones=$zones");
$response = $ua->request($request);
mark("start update",100,"hello");
if ($response->is_success) {
#record successful update of the ip address
open S, ">$ipfile";
print S $ip;
close S;
} else {
mark("ERROR", $response->code, $response->message);
}
}
sleep(10);
}
sub mark {
my ($type, $code, $message) = @_;
open E, ">>$logfile";
print localtime()."/t$type/t".$code."/t".$message."/n";
print E localtime()."/t$type/t".$code."/t".$message."/n";
close E;
}
sub clear {
open E, ">$logfile";
close E;
}
# - Erik Aronesty,
# ZoneEdit, Inc.
加红的部分为添加的内容,添加了如下内容就可以实现对在ADSL路由内的共享上网环境支持,不过ZONEEDIT国内好像不行,这个到国外一定没有问题
本文介绍两种动态域名解析(DDNS)方案:一是使用科迈的comexe.cn免费服务,在FreeBSD环境下配置并启用DDNS客户端;二是通过Zoneedit实现DDNS更新,包括定制Perl脚本来支持ADSL路由内共享上网环境。
2021

被折叠的 条评论
为什么被折叠?



