NTP DNS Entries

It would be nice if for the NTP client you could use a DNS entry rather then an IP address. NTP.org provides pool.ntp.org that has a large number of time servers in its database. You do not run the risk of overloading one time server either.

Matt

This has been asked before on this forum. You can enter an DNS address instead of an IP, but it just converts it to the IP address of the domain address. For pool.ntp.org it will only choose 1 IP address from the list it gets back from your DNS server.

The solution is to use a script to set the address every time the router boots up. You could also run it once a week to make sure you don’t have a NTP server from the pool that is currently down. Also use multiple different pool addresses to make sure you get different IP addresses for different NTP servers, use 0.pool.ntp.org & 1.pool.ntp.org. In Latvia use: 0.lv.pool.ntp.org & 1.europe.pool.ntp.org, in the United States use: 0.us.pool.ntp.org & 1.us.pool.ntp.org. Mikrotik may change this in the future, but currently you need to do a work around like this.

MikroTik RouterOS View topic - DNS resolver
create a script with this in it:

/system ntp client set primary-ntp=[:resolve 0.pool.ntp.org]
/system ntp client set secondary-ntp=[:resolve 1.pool.ntp.org]

8 years are passed… still not fixed?
Even dummy ASUS has it…

It is actually “fixed” (quoted since this was not a bug, but rather a lack of feature) since RouterOS 6.18 (release Aug 01, 2014).

PS. I suggest you consulting the ChangeLogs and searching the forum first the next time you decide to necropost here.

Yes you can use a dns record but only in the built in SNTP client. The NTP client in the NTP package does not support this as far as I know.

Not sure what you mean regarding NTP package and SNTP client.. But I think it is not possible:

http://192.168.88.1/webfig/#System:SNTP_Client

Primary NTP Server: europe.pool.ntp.org

Invalid value in Primary NTP Server

I think I got required behaviour with Server DNS names.

Not most straightforward behaviour but it work… Primary NTP Server should be 0.0.0.0.

This a bit of a lack on the side of Mikrotik. The default value is 0.0.0.0 as stated in the Wiki: primary-ntp (IP address default: 0.0.0.0).

Desired behavior of Winbox for fields:

  • if there is a default value and the field is left blank on apply, insert default value
  • if the field is optional and when the field is left blank on apply then disable it

This would solved this interpretation by the user and Mikrotik knows the correct working and the customer has to look it up to be able to set the default settings.

It’s been solved… don’t know wich version. I paste my ntp client print configuration

enabled: yes
primary-ntp: 0.0.0.0
secondary-ntp: 0.0.0.0
server-dns-names: 1.es.pool.ntp.org
mode: unicast
dynamic-servers: 46.16.60.129

You can use the command:

/system ntp client set enabled=yes server-dns-names=1.es.pool.ntp.org

Hi,

Seems still not solved?

Software/hardware:

RouterOS 6.45.7
model = RB450Gx4

Recommended syntax in previous post fails:

/system ntp client set enabled=yes server-dns-names=lv.pool.ntp.org
expected end of command (line 1 column 36)

The following syntax fails:

/system ntp client set enabled=yes primary-ntp=lv.pool.ntp.org secondary-ntp=lv.pool.ntp.org
invalid value for argument primary-ntp:
invalid value for argument address4
invalid value for argument address

Using IP addresses succeeds:

/system ntp client set enabled=yes primary-ntp=193.40.5.113 secondary-ntp=81.20.144.33

/system ntp client> print
enabled: yes
mode: unicast
primary-ntp: 193.40.5.113
secondary-ntp: 81.20.144.33
dynamic-servers:
status: synchronized

Also, using “:resolve” syntax succeeds:

/system ntp client set primary-ntp=[:resolve lv.pool.ntp.org] secondary-ntp=[:resolve lv.pool.ntp.org]

/system ntp client> print
enabled: yes
mode: unicast
primary-ntp: 80.232.246.10
secondary-ntp: 162.159.200.1
dynamic-servers:
status: synchronized

Regards,
Marek Läll

PS: package list

/system package print
Flags: X - disabled

NAME VERSION

0 ntp 6.45.7
1 routeros-arm 6.45.7
2 system 6.45.7
3 X ipv6 6.45.7
4 wireless 6.45.7
5 hotspot 6.45.7
6 mpls 6.45.7
7 routing 6.45.7
8 ppp 6.45.7
9 dhcp 6.45.7
10 security 6.45.7
11 advanced-tools 6.45.7

In case someone still have this same issue. I used the command below and it worked:

system ntp client set server-dns-names=time.nist.gov
system ntp client set enabled=yes
system ntp client print
enabled: yes
primary-ntp: 0.0.0.0
secondary-ntp: 0.0.0.0
server-dns-names: time.nist.gov
mode: unicast
poll-interval: 15m
active-server: 132.163.96.3
last-update-from: 132.163.96.3
last-update-before: 4m53s710ms
last-adjustment: -7ms115us

Another thing is now you can do:


/]ip cloud set update-time=yes

It will be dependent on Mikrotik servers then.