动态域名的申请(dns0755.net)
动态域名的申请(dns0755.net)
前言
通过PPPoE方式xDSL接入网络的用户,每次获得的IP地址是变化的。我们不可能让别人用IP地址来访问我们的服务器,而且普通免费的二级域名又无法应付服务器IP即时的变化。所以,需要申请一个动态域名,通过服务端对域名指向的实时控制,达到无论服务器IP地址怎样变化,外部用户在任何时候都能 通过此域名来正常访问服务器的目的。
在国内,有一些动态域名提供商,比如比较有代表性的 希网(不能解析内网IP地址) 、科迈、花生壳 下面以科迈的动态域名解析服务为例,讲解其申请、linux安装方法
功能简介:
- 动态IP地址更新
- 支持Linux、FreeBSD、OpenBSD、Solaris Sparc、Solaris X86、unixware
- 支持ADSL共享器/路由器的上网方式
- 支持顶级域名及其子域名的自动离线功能
- 多域名解析,不限制域名个数
动态域名申请
打开科迈动态域名官方网站 http://www.dns0755.net 点击免费试用图标,按官方提示进行申请。
下载和安装
请下载相应系统的版本,地址:http://www.dns0755.net/ddns_assistant_dn.php
[root@localhost src]# wget http://www.dns0755.net/client/linux_i.tar.gz ← 下载动态域名解析程序 --20:37:39-- http://www.dns0755.net/client/linux_i.tar.gz => `linux_i.tar.gz.1' Resolving www.dns0755.net... 219.134.132.131 Connecting to www.dns0755.net|219.134.132.131|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 216,527 (211K) [application/x-tar] 100%[================================================================= ================================================>] 216,527 104.03K/s 20:37:41 (103.84 KB/s) - `linux_i.tar.gz.1' saved [216527/216527] [root@localhost src]# tar zxvf linux_i.tar.gz ←解压文件 pipclient [root@localhost src]# mkdir /usr/local/comexe ←建立程序工作目录 [root@localhost src]# mv pipclient ../local/comexe/ ←把解压好的文件移动到工作目录文件夹下
配置
[root@localhost comexe]# ./pipclient ←运行配置向导 Usage: pipclient -h -c -w /home/pipclient -h: help message. -c: do configuration. -w <dir>: set work directory. Do configuration now. Input User name: test ←在科迈网注册的用户名 Input Password: test ←科迈网用户密码 Input Domain: test.dns0755.net ←申请的免费二级域名 Input Offline URL or Offline IP(Enter for none): ←域名离线URL。如果没有请直接按回车。 Has another domain?(Y/N): N ←如果要解析多个域名,请按“Y”,逐个输入域名及其离线URL。 080425 193929:MESG: COMEXE DDNS (Public IP) Ver 2.00a Build 104 Copyright (c) 2003 Shenzhen COMEXE Communication Technology Co. Ltd. All Rights Reserved. http://www.comexe.cn 080425 193930:MESG:服务启动. 080425 204019:INFO:Connected to:219.134.132.132:9994 ←动态域名程序通讯端口。 080425 204019:INFO:Connected to:219.134.132.132:9993 ←动态域名程序通讯端口。 080425 204019:MESG:登录成功! 出口IP是: 121.32.19.203 080425 204020:INFO:121.32.19.203 N 20 ←返回ip地址,登录成功。
可按“Ctrl+C”退出。
如果以后要修改配置,请运行:$ ./pipclient -c
设置开机运行
pipclient要在系统启动时以后台进程运行。请修改系统启动脚本,加入如下命令:
nohup /usr/local/comexe/pipclient -w /usr/local/comexe &
其中“-w”参数指定工作目录。
[root@localhost local]# vi /etc/rc.local ←修改开机脚本 #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local nohup /usr/local/comexe/pipclient -w /usr/local/comexe & ←在文件内容最好添加此句。
2条评论 关于 “动态域名的申请(dns0755.net)”
由 jiagoo 发表于2008-05-21
每步(www.meibu.com)动态域名解析源代码,ADSL架设VPN的帮手,利用动态域名解析,可以把ADSL上网电脑建立VPN服务,完整代码下载地址 http://www.noip.cn/ddns.asp
源码如下:
unit ddnsunit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdComponent, IdUDPBase, IdUDPClient, IdBaseComponent,
IdAntiFreezeBase, IdAntiFreeze, StdCtrls,link,shellapi, ComCtrls, ExtCtrls,
OleCtrls, SHDocVw;
type
TForm1 = class(TForm)
nameedit: TEdit;
passedit: TEdit;
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
dlrz: TMemo;
UDPAntiFreeze: TIdAntiFreeze;
UDPClient: TIdUDPClient;
StatusBar1: TStatusBar;
Timer1: TTimer;
Timer2: TTimer;
wgip: TEdit;
Label3: TLabel;
ipdz: TEdit;
Label4: TLabel;
Label5: TLabel;
Memo1: TMemo;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Label5Click(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
MyStream: TMemoryStream;
MySendTxt,reciver_s,ym_s,bb_s: String;
MessageID: Integer;
ThisMessage: String;
ReceivedString,dkhm: String;
Begin
if nameedit.Text=\’\’ then begin StatusBar1.Panels[1].Text:=\’ 请输入用户名。\’; nameedit.SetFocus;exit;end;
if passedit.Text=\’\’ then begin StatusBar1.Panels[1].Text:=\’ 请输入密码。\’;passedit.SetFocus;exit;end;
UDPClient.Port :=7688;
UDPClient.Host :=\’shiyanbanben.noip.cn\’;{远程主机}
MysendTxt:= nameedit.Text+\’&\’+passedit.text;
MessageID := Random(MAXINT);
ThisMessage:= \’shiyanbanben\’+nameedit.Text+\’&&&\’+passedit.text+\’&&&\’;
try
UDPClient.Send(ThisMessage); timer1.Interval :=1500;
except
StatusBar1.Panels[1].Text:=\’ 登录失败,线路不通! \’;
exit;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
MyStream: TMemoryStream;
MySendTxt,reciver_s,ym_s,bb_s,ip_s: String;
MessageID: Integer;
ThisMessage: String;
ReceivedString,dkhm: String;
begin
try
ReceivedString := UDPClient.ReceiveString();
if ReceivedString = \’\’ then
timer1.Interval :=0
else
begin
timer1.Interval :=1500;
reciver_s:=ReceivedString;
ym_s:=reciver_s;
if copy(reciver_s,1,8)=\’stopfuwu\’ then begin timer1.Interval:=0;end;
if copy(reciver_s,1,8)=\’dengluok\’ then
begin
Timer2.Interval :=15000; //开始检查IP
StatusBar1.Panels[1].Text:=\’ 登录成功! \’;
ym_s:=copy(ym_s,12,pos(\’&&&\’,ym_s)-12);
bb_s:=copy(reciver_s,pos(\’&&&\’,reciver_s)+3,length(reciver_s));
ip_s:=copy(bb_s,1,pos(\’&&&\’,bb_s)-1);
wgip.Text :=ip_s;
ipdz.Text :=getips;
bb_s:=copy(bb_s,pos(\’&&&\’,bb_s)+3,length(bb_s));
bb_s:=copy(bb_s,1,pos(\’&&&\’,bb_s)-1);
reciver_s:=copy(reciver_s,9,1);
if pos(\’Repeat landing\’, ym_s)>0 then
dlrz.Lines.Add(\’域名重复登录成功,IP是 \’+ip_s+\’ 时间 \’+datetostr(date())+\’ \’+TimeToStr(Time)+\’ 用户(\’+nameedit.text+\’)\’)
else
dlrz.Lines.Add(\’域名:\’+ym_s+\’ 登录成功,IP是 \’+ip_s+\’ 时间 \’+datetostr(date())+\’ \’+TimeToStr(Time)+\’ 用户(\’+nameedit.text+\’)\’);
end;
if copy(reciver_s,1,12)=\’nzhuceyonghu\’ then
begin
dlrz.Lines.Add(datetostr(date())+\’ \’+TimeToStr(Time)+\’ \’+nameedit.text+\’ 登录失败!\’);
reciver_s:=copy(reciver_s,13,1);
StatusBar1.Panels[1].Text:=\’ 输入有误或没注册,请看弹出窗口! \’;
end;
end;
except
StatusBar1.Panels[1].Text:=timetostr(now)+\’ 登录失败,线路不通\’;
end;
end;
procedure TForm1.Label5Click(Sender: TObject);
begin
shellexecute(handle, \’OPEN\’, \’http://www.noip.cn/regedit.shtml\’, pchar(\’www.meibu.com/khd.asp\’), nil, SW_SHOW) ;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
if ipdz.Textgetips then
begin
timer2.Interval :=0;//如果本机IP改变,则从新登陆
button1.Click ;
end;
end;
end.
由 李 海鑫 发表于2008-05-23
多谢,我以前也用过“每步”,迟点我在写一篇相关的文章