Community discussions

MikroTik App
 
gfra
just joined
Topic Author
Posts: 3
Joined: Sat Dec 24, 2016 4:02 pm

Minimal script for Namecheap DNS update

Sat Dec 24, 2016 4:27 pm

Hi all,
just wanted to share my reduced and adapted script to update a subdomain registered on namecheap.
It's the bare minimum required, plus the logging instruction.
:global ddnshostname "SUBDOMAIN"
:global ddnsdomain "YOUR_DOMAIN.COM"
:global ddnspass "5f66f2af8491226967965b1eaea50265_<-YOUR_NAMECHEAP_DYNDNS_KEY"

:log info ("DDNS: Updating")
:local str "https://dynamicdns.park-your-domain.com/update\3Fhost=$ddnshostname&domain=$ddnsdomain&password=$ddnspass"
/tool fetch url=($str) mode=https keep-result=no
A few notes:
  • You need read and test permission only
  • It's tested and working with ROS 6.37.3 (stable)
  • keep-result=no prevent the fetch command to save the result file on disk, which is out of the scope of the script
  • You don't need to get your public IP from your WAN interface or wherever and send it, since namecheap use the source IP of the fetch command by default (ref: here)
Hope it helps, cheers!
 
User avatar
zipvault
Member Candidate
Member Candidate
Posts: 140
Joined: Fri Dec 23, 2016 8:15 am

Re: Minimal script for Namecheap DNS update

Sun Dec 25, 2016 5:23 am

Very interesting, thanks i will look into this

is like dyn dns?

Im trying to make my own name server
 
gfra
just joined
Topic Author
Posts: 3
Joined: Sat Dec 24, 2016 4:02 pm

Re: Minimal script for Namecheap DNS update

Tue Dec 27, 2016 1:12 pm

Yes the idea behind is a service like DynDNS.
The difference is that you have to own a domain name registered on namecheap.com, the script allow you to update a subdomain DNS A record every time it is run (ex: foo.bar.com if you own bar.com).
I scheduled mine to run every hour.
 
User avatar
zipvault
Member Candidate
Member Candidate
Posts: 140
Joined: Fri Dec 23, 2016 8:15 am

Re: Minimal script for Namecheap DNS update

Wed Dec 28, 2016 1:07 pm

you have to own a domain name registered on namecheap.com, .
,

ok some of mine are with crazydomains.com though

im looking into C name maybe i can do it through C name
 
User avatar
soonwai
Member Candidate
Member Candidate
Posts: 186
Joined: Mon Feb 06, 2012 10:50 pm
Location: Kuala Lumpur

Re: Minimal script for Namecheap DNS update

Mon Feb 20, 2017 7:13 pm

Thanks for this. It's certainly very minimal. I posted a script for Namecheap too but it's the opposite of minimal.

http://forum.mikrotik.com/viewtopic.php ... 4&p=533043

Who is online

Users browsing this forum: No registered users and 28 guests