Community discussions

MikroTik App
 
hci
Long time Member
Long time Member
Topic Author
Posts: 619
Joined: Fri May 28, 2004 5:10 pm

NTP DNS Entries

Fri Sep 26, 2008 7:30 pm

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
 
User avatar
roadrunner
Frequent Visitor
Frequent Visitor
Posts: 86
Joined: Thu May 18, 2006 11:22 pm
Location: US

Re: NTP DNS Entries

Mon Sep 29, 2008 3:25 am

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]
 
hardtik
just joined
Posts: 8
Joined: Sat Apr 15, 2017 11:00 pm

Re: NTP DNS Entries

Sat Apr 15, 2017 11:37 pm

8 years are passed... still not fixed?
Even dummy ASUS has it....
 
andriys
Forum Guru
Forum Guru
Posts: 1353
Joined: Thu Nov 24, 2011 1:59 pm
Location: Kharkiv, Ukraine

Re: NTP DNS Entries

Sun Apr 16, 2017 4:36 pm

8 years are passed... still not fixed?
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.
 
Kindis
Member Candidate
Member Candidate
Posts: 284
Joined: Tue Nov 01, 2011 6:54 pm

Re: NTP DNS Entries

Sun Apr 16, 2017 6:58 pm

8 years are passed... still not fixed?
Even dummy ASUS has it....
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.
 
hardtik
just joined
Posts: 8
Joined: Sat Apr 15, 2017 11:00 pm

Re: NTP DNS Entries

Sun Apr 23, 2017 11:11 am

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
 
hardtik
just joined
Posts: 8
Joined: Sat Apr 15, 2017 11:00 pm

Re: NTP DNS Entries

Sun Apr 23, 2017 11:17 am

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.
 
msatter
Forum Guru
Forum Guru
Posts: 1710
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: NTP DNS Entries

Sun Apr 23, 2017 2:17 pm

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.
One RB4011 (cooled) and a RB760iGS (hEX S) in series. The 4011 Does PPPoE/IKEv2.
The cooler: viewtopic.php?f=3&t=138613&start=300#p799879
Running:
RouterOS 6.47 / Winbox 3.24 / MikroTik APP 1.3.14
 
emmmm
just joined
Posts: 3
Joined: Mon Jun 26, 2017 7:20 pm

Re: NTP DNS Entries

Thu Sep 28, 2017 11:45 am

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
 
mareklall
just joined
Posts: 2
Joined: Tue Jun 28, 2011 11:26 am

Re: NTP DNS Entries

Mon Dec 09, 2019 2:51 pm

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
 
dtv7288
just joined
Posts: 1
Joined: Mon Jun 22, 2020 1:31 am

Re: NTP DNS Entries

Mon Jun 22, 2020 1:35 am

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
 
hci
Long time Member
Long time Member
Topic Author
Posts: 619
Joined: Fri May 28, 2004 5:10 pm

Re: NTP DNS Entries

Mon Jun 22, 2020 4:29 pm

Another thing is now you can do:

/]ip cloud set update-time=yes

It will be dependent on Mikrotik servers then.

Who is online

Users browsing this forum: No registered users and 77 guests