OpenWRT 上面配置动态域名
以前的 TP-Link 也支持 DDNS, 但是只能指定几家常见 DDNS 服务商,不能使用自己域名的 dns, 这个用起来很不爽,现在使用 OpenWRT 这样的开放系统,动态 DNS 就成为了很简单的一件事情。
因为我现在并没有可以稳定的能够被全球访问到的服务器,因此现在我的 ns 还都是挂在 zoneedit 下面的。值得高兴的是 zoneedit 支持动态 dns 更新,只需要加一个 A 记录,就可以用动态 dns 客户端来更新之。
首先在 OpenWRT 上面安装 ez-ipupdate
ipkg install ez-ipupdate
然后改一下配置
cat > /etc/ez-ipupdate.conf
service-type=zoneedit
user=myname:mypassword
interface=eth0
host=home.kangkang.org
# Do not change the lines below
cache-file=/tmp/ez-ipup
pid-file=/var/run/ez-ipupdate.pid
里面用户名密码改成自己的 zoneedit 帐号,host 改成你要更新的域名。 interface 表示在哪个 interface 起来的时候去更新域名,如果用 pppoe 或者 pptp 的,就改成 ppp0, 直接局域网 dhcp 的,就用 vlan1 或者 vlan2, 视配置而定。
然后把 wan 口 down 并 up ,就成功了
ifdown wan && ifup wan
更详细的配置在 OpenWRT 官方 wiki 上面有。
不过一个缺陷是, zoneedit 不允许将 TTL 设置到 1200 秒以下,也就是说,每次更新最多可能需要 2400 秒也就是 40 分钟才能够传播开来。这个对于动态 DNS 来说还是有些不够爽。
直接自己架设用nsupdate….
那个东西上面好像没有 bind-utils ,应该是 bind-utils 太肥大了塞不进 rom 吧。。
自己写一个小程序,构造一个DNS notify请求发送出去,程序不会有多大的.
这不懒得写吗,跪请您出手。Orz!
如果自己有DNS Server的话,用gnudip/minidip配合ez-ipupdate很方便的。
记下了,回去试验一下,多谢多谢
使用http定时提交到远程页面,让远程的web server去更新dns
;P
ps:验证码太复杂了.
那个ez-ipupdate在pppoe时有问题,functions.sh里的do_ifup没有判断pppoe,加上那一个不支持3322
自己编译了一个ez-ipupdate for 3322.org
源码
http://www.3322.org/dyndnspage/ez-ipupdate-3.0.10.tgz
编译
mipsel-linux-gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c ez-ipupdate.c
mipsel-linux-gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c conf_file.c
mipsel-linux-gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c md5.c
mipsel-linux-gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c cache_file.c
mipsel-linux-gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c pid_file.c
mipsel-linux-gcc -g -O2 -o ez-ipupdate ez-ipupdate.o conf_file.o md5.o cache_file.o pid_file.o
运行
ez-ipupdate -i ppp0 -h test.3322.org -S qdns -u test:pass
加到/sbin/ifup.pppoe的最后去。