有三种方法,
- 使用花生壳和www.dns0755.net国内商业提供的DDNS收费服务,可以绑定顶级域名(推荐,不过需要交年费)
- 使用域名管理面板的别名服务指向免费DDNS服务商提供的二级域名(不过我测试,稳定性不好,优点是无需转移DNS)
- 使用www.zoneedit.com提供的DDNS服务,不过需要把域名的DNS服务器设置到zoneedit指定的DNS服务器,(这个比较好,且免费)
下面就详细描述一下如何使用www.zoneedit.com提供的DDNS服务进行顶级域名绑定动态IP地址的步骤
动态域名配置需要ddclient包,可以通过yum -y install ddclient安装,需先安装
- 去 zoneedit 注册一个账号,它会把用户名和密码发到你的邮箱里;
- 把你域名的DNS改成: ns13.zoneedit.com 和 ns17.zoneedit.com ;(万网的域名解析比较慢,等吧……)
- 把域名(以 15099.net 为例)加入 zoneedit 的 zone 中;
- 编辑 zone 的”IP addresses (A)”选项, 添加 15099.net、www.15099.net 和 *.15099.net 添加到你目前的公网IP(使用 whois 查询);
- 你也可以把二级域名定向到不同的主机上,总之主动权在你自己手中哦
编辑 /etc/ddclient/ddclient.conf
######################################################################
daemon=300 # check every 300 seconds
syslog=yes # log update msgs to syslog
mail=root # mail all msgs to root
mail-failure=root # mail failed update msgs to root
pid=/var/run/ddclient.pid # record PID in file.
ssl=yes # use ssl-support. Works with
# ssl-library
##
## ZoneEdit (zoneedit.com)
##
server=www.zoneedit.com, \
protocol=zoneedit1, \
use=web,web=www.who.is/,web-skip='Your IP is ' \
login=邮件中的用户名, \
password=邮件中的密码 \
www.15099.net
15099.net
启动ddclient
/etc/init.d/ddclient start
测试是否成功更新
[root@localhost ~]# tail -n 3 /var/log/messages Oct 24 15:21:31 localhost ddclient[2837]: SUCCESS: updating www.15099.net: IP address set to 121.32.164.79 (200: Update succeeded.) Oct 24 15:25:26 localhost ddclient[2837]: WARNING: caught SIGTERM; exiting Oct 24 15:25:28 localhost ddclient[2869]: SUCCESS: updating 15099.net: IP address set to 121.32.164.79 (200: Update succeeded.) [root@localhost ~]#
备注:我测试是用dnspark,好像总是不成功,应该是现在的免费帐号不支持顶级域名更新了
另外ZoneEdit的URL转发功能(WebForward)在国内不能使用,不过我通过登录国外的服务器,使用lynx命令可以正常访问,有点遗憾…
参考资料:
http://mifunny.info/use-dynamic-domain-under-linux-126.html
标签: DDNS