Community discussions

 
jongo
just joined
Topic Author
Posts: 1
Joined: Wed Aug 22, 2018 6:31 am

help me for scheduler command / script to update DNS ips

Sat Sep 01, 2018 3:12 pm

Hi All,
I am an end user of Mikrotik.
I need to have a command / script which runs at scheduled intervals to retrieve DNS IPs from OpenNIC url https://api.opennicproject.org/geoip/?res=4&bare&adm=4 and update my DNS IPs accordingly.
I have succeeded in getting ip file.
/tool fetch url="https://api.opennicproject.org/geoip/?res=4&bare&adm=4" dst-path=dns.txt;
/ip dns set server=[/file get [/file find name=dns.txt] contents];
But, as I am getting each ip with separate line so, routeros is not accepting the ips as it only accepts comma separated ips.
Can anybody help me to convert this text file contents to convert it in acceptable format.
I don't know scripting and this may help others too.
Thanks.

Who is online

Users browsing this forum: No registered users and 14 guests