Community discussions

MikroTik App
 
sejtam
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 67
Joined: Sun Dec 14, 2014 4:23 pm

NTP pool script

Sun Jan 04, 2015 9:24 pm

I found http://wiki.mikrotik.com/wiki/Manual:Sc ... ce_for_NTP which looks useful.

sadly however, most caching DNS servers implement a round-robin scheme, so that two consecutive queries for a name with multiple addresses return these in a different order:
0.asia.pool.ntp.org.	147	IN	A	129.250.35.250
0.asia.pool.ntp.org.	147	IN	A	192.248.1.162
0.asia.pool.ntp.org.	147	IN	A	212.26.18.43
0.asia.pool.ntp.org.	147	IN	A	82.200.209.236
asia.pool.ntp.org.	150	IN	A	202.65.114.202
asia.pool.ntp.org.	150	IN	A	202.73.36.32
asia.pool.ntp.org.	150	IN	A	194.225.50.25
asia.pool.ntp.org.	150	IN	A	193.29.53.170
This makes thsi script change the NTP servers with every run of the script, which is suboptimal.

It would be nice if teh script could be extended to retrieve the complete list fo returned addresses, and then
check if any one of them is already used, and then not to change that NTP server.

The :resolve command however seems to only return the first address.

Has anyone found a way to make :resolve returns a list of addresses (or am I missing how to use that)?



One reason I'd like to not change the address of the NTP servers frequently is due to the fact that then the NTP
client needs to establish a stable connection again, which can take a while.. (or is the NTP client also just SNTP
and thus does not keep a proper NTP association with the configured servers?)