重要脚本--关于dns-update-动态域名的
# Dynamic DNS Update Script v1.1# ------------------------------
# This script will perform automatic dynamic dns updates on the Mikrotik
# router platform.(http://www.mikrotik.com/)Since Mikrotik does not
# support sending http requests we have created a smtp -> ddns proxy service
# which will take the http URL querystring used for a dynamic dns update and
# process it via email.
# ------------------------------
# Written by Sam Norris, ChangeIP.com
# 7/31/04 - Created script.
# 12/9/04 - Made some values dynamic (smtp server, dhcp interface)
# ------------------------------
#
# Instructions:
# There are a few variables down below that you need to configure for your
# specific setup.Please modify the variables in the 'ddnsInit' script to
# reflect your specific information, ie userid, password, hostname to update.
#
# Blow away any existing script code, if necessary.
/system scheduler remove ddnsJob
/system script remove ddnsCheck
/system script remove ddnsInit
/system script remove ddnsReset
/system script remove ddnsSendUpdate
# Setup global variables needed to keep track of changing IP address.
/system script add name="ddnsInit" source={
:log message="ddnsInit: Creating Dynamic DNS update system."
# ENTER YOUR CHANGEIP.COM USER ID HERE.
:global u
:set u "USERID"
# ENTER YOUR CHANGEIP.COM PASSWORD HERE.
:global p
:set p "PASSWORD"
:global s
:set s "Mikrotik"
# ENTER THE TARGET HOSTNAME TO UPDATE, *1 is Set 1.
:global h
:set h "*1"
:global dhcpInterface
:set dhcpInterface [ /ip dhcp-client get interface ]
:log message=("ddnsInit: Found dhcp interface " . $dhcpInterface )
# EMAIL PROXY ADDRESS - DO NOT CHANGE FOR PRODUCTION.
:global ddnsProxyEmail
:set ddnsProxyEmail "ddnsUpdate@ChangeIP.com"
# ENTER YOUR EMAIL ADDRESS FOR CONFIRMATIONS.
:global ddnsFromEmail
:set ddnsFromEmail "youremail@domain.tld"
# SMTP DDNS PROXY SERVER - CHANGE ONLY IF NECESSARY (port 25 blocked?)
:global ddnsSmtpServer
:set ddnsSmtpServer [:resolve smtp.changeip.com]
:global a
:set a [ \
/ip address get \
\
address \
]
}
/system script add name="ddnsCheck" source={
:if ( 能用吗? 不会用啊? 不错哦. 能不能说明一下各行代码什么意思?不行也说详细点 这么好的帖子,关注的人不多阿。一楼的脚本肯定能用,我做了实验,但是把内网的地址解析过去了,正在研究中,好了分享。 he he 成功完成动态域名更新,正在整理中,另外建新帖发布后请斑竹加到精华区。 留个记号!
页:
[1]