在DNSEver自动更新动态IP

DNSEver.com Free DNS Service (nameserver), Dynamic DNS.

新建一个ddns.sh的文件,代码为

<code>#!/bin/sh /usr/bin/wget -O - --http-user=ID --http-passwd=authcode 'http://dyna.dns ever.com/update.php?Update_String' </code>

将其中的ID改成用户名,authcode改成认证码,这些都可以在账户设置里面查到,注册的时候也会有。

然后将update_string修改成host[Dynamic_DNS_Host],这里把Dynamic_DNS_Host改成需要更新的域名。如果有多个域名需要更新,就用&来连接。这里具体的用法可以参考原网站。

Update_String: Write the details that will be updated with dynamic DNS. The form is as follows.
Ex.)
1. If only one host is updated (It is setup in online state. IP address is setup automatically in the server)

host[Dynamic_DNS_Host]

2. If a host is updated by a specific IP (Ex.: 110.120.130.140)

host[Dynamic_DNS_Host]=110.120.130.140

3. If the host is setup offline

host[Dynamic_DNS_Host]=offline

4. If several hosts are updated, they can be input by arranging with ‘&’.
Ex.1) bbs.myhome.com and www.myhome.com are updated with an automatic IP and are setup in online state

host[bbs.myhome.com]&host[www.myhome.com]

Ex.2) bbs.myhome.com is changed in offline state. www.home.com updates an IP automatically and is setup in online state. host[bbs.myhome.com]=offline&host[www.myhome.com]

加入到系统开机运行

[root]# vi /etc/crontab
*/5 * * * * root /usr/local/bin/ddns.sh > /dev/null 2>&1

[root]# vi /etc/rc.d/rc.local
/usr/local/bin/ddns.sh


评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注