routeros dns_从RouterOS在FreeDNS上进行动态DNS更新

routeros dns

免费DNS (FreeDNS)

FreeDNS (https://freedns.afraid.org/) offers free DNS hosting for up to 5 subdomains. You can set up a domain like example.mooo.com and point it to any IP you want.

FreeDNS( https://freedns.afraid.org/ )提供最多5个子域的免费DNS托管。 您可以设置一个域名,例如example.mooo.com,并将其指向您想要的任何IP。

I wanted to set up Dynamic DNS updates, so that a certain subdomain would always point to my (potentially changing) home IP. The setup on FreeDNS is quite simple:

我想设置动态DNS更新,以便某个子域将始终指向我的(可能更改的)家庭IP。 FreeDNS上的设置非常简单:

  1. Add a new subdomain (Type A) on https://freedns.afraid.org/subdomain/
  2. Go to https://freedns.afraid.org/dynamic/v2/
  3. Select your subdomain and enable Dynamic DNS
  1. https://freedns.afraid.org/subdomain/上添加新的子域(类型A)
  2. 转到https://freedns.afraid.org/dynamic/v2/
  3. 选择您的子域并启用动态DNS

Next to your subdomain, a sync URL is automatically generated. It looks like this: http://sync.afraid.org/u/<random-token>/. If you request that URL with an HTTP client, the IP will automatically be updated:

在您的子域旁边,会自动生成一个同步URL。 看起来像这样: http : //sync.afraid.org/u/<random-token>/ 。 如果您通过HTTP客户端请求该URL,则IP将自动更新:


$ curl https://sync.afraid.org/u/<random-token>/
Updated asdfasdfdsdasasdf.chickenkiller.com from 46.38.XX.XX to 213.144.XX.XX

Note that the URL displayed in the FreeDNS web interface is using the insecure http:// protocol by default, you should change that to https:// instead.

请注意,默认情况下,FreeDNS Web界面中显示的URL使用的是不安全的http://协议,您应该将其更改为https://

在Mikrotik RouterOS上进行设置 (Setup on Mikrotik RouterOS)

Configuring your Mikrotik router to periodically update the IP is also very simple using the following one-line script:

使用以下单行脚本将Mikrotik路由器配置为定期更新IP也非常简单:


/system script
    add comment="Update DynamicDNS on freedns.afraid.org" name=dyndns-afraid 
    source="/tool fetch url="https://sync.afraid.org/u/<random-token>/""

Finally, schedule this script to be executed every 5 minutes:

最后,安排此脚本每5分钟执行一次:


/system scheduler
    add disabled=no start-time=startup interval=5m name=dyndns-afraid 
    on-event="/system script run dyndns-afraid"

(Small sidenote: The RouterOS “fetch” command does not verify the validity of the HTTPS certificate by default. You should probably add the root certificate used by the host to your certificate store and add the check-certificate=yes option to the fetch command.)

(小边注:默认情况下,RouterOS“ fetch”命令不会验证HTTPS证书的有效性。您可能应该将主机使用的根证书添加到证书存储中,并在fetch命令中添加check-certificate = yes选项。 )

翻译自: https://www.pybloggers.com/2016/07/dynamic-dns-updates-on-freedns-from-routeros/

routeros dns

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值