找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 5323|回复: 8

[脚本] 重要脚本--关于dns-update-动态域名的

[复制链接]
发表于 2005-9-28 19:09:15 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
# 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 \
      [/ip address find interface=$dhcpInterface] \
      address \
    ]

  }

/system script add name="ddnsCheck" source={
  :if ([/system scheduler get ddnsJob run-count]
routeros
发表于 2005-9-28 19:42:06 | 显示全部楼层
能用吗?
routeros
回复

使用道具 举报

发表于 2005-9-28 21:56:50 | 显示全部楼层
不会用啊?
routeros
回复

使用道具 举报

发表于 2005-9-29 09:16:34 | 显示全部楼层
不错哦.
routeros
回复

使用道具 举报

发表于 2005-9-29 09:42:14 | 显示全部楼层
能不能说明一下各行代码什么意思?不行也说详细点
routeros
回复

使用道具 举报

发表于 2005-10-4 15:15:38 | 显示全部楼层
这么好的帖子,关注的人不多阿。一楼的脚本肯定能用,我做了实验,但是把内网的地址解析过去了,正在研究中,好了分享。
routeros
回复

使用道具 举报

发表于 2005-10-4 19:33:43 | 显示全部楼层
he he
routeros
回复

使用道具 举报

发表于 2005-10-5 10:16:22 | 显示全部楼层
成功完成动态域名更新,正在整理中,另外建新帖发布后请斑竹加到精华区。
routeros
回复

使用道具 举报

发表于 2006-11-21 15:22:19 | 显示全部楼层
留个记号!
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-9-30 17:40 , Processed in 0.054200 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表