Community discussions

MikroTik App
 
User avatar
Berlis
just joined
Topic Author
Posts: 5
Joined: Sun Apr 18, 2021 4:11 pm
Location: Poland

Is it possible to set up NTP Server using name address instead of IP address?

Mon Jun 14, 2021 1:27 am

Hi, everyone.

Quick question: is there a way to set up NTP Server on RouterOS using name address instead of IP address?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19103
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Is it possible to set up NTP Server using name address instead of IP address?

Mon Jun 14, 2021 3:33 pm

Not sure what you mean.

At the NTP server settings there is really not a spot for name you just enable the service.
At the NTP client setting you can put in domain names or IPs for national or international ntp servers?
 
User avatar
Berlis
just joined
Topic Author
Posts: 5
Joined: Sun Apr 18, 2021 4:11 pm
Location: Poland

Re: Is it possible to set up NTP Server using name address instead of IP address?

Mon Jun 14, 2021 5:50 pm

Ofcourse, You're right - i was thinking about SNTP Client. What I want to know is how MikroTik stores server address. When i put address as domain name it is converted to IP address. What will happen when IP address for specified domain is changed?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Is it possible to set up NTP Server using name address instead of IP address?

Mon Jun 14, 2021 5:57 pm

You have to change it within the sntp configuration.
If it's so important to you,
"create" your NTP server with the RouterOS add-on package and set all your clients to use that IP
 
User avatar
Berlis
just joined
Topic Author
Posts: 5
Joined: Sun Apr 18, 2021 4:11 pm
Location: Poland

Re: Is it possible to set up NTP Server using name address instead of IP address?

Wed Jun 16, 2021 11:32 pm

It's not that important. I'm new to MikroTik world and learn as I go. Untill now I was using mainly TP-LINK, where it's possible to enter domain name and it won't be converted to IP address. It's weird though that RouterOS as advanced as it is doesn't support it, since every time service website i visited says that "It is strongly recommended to use name instead of IP".
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Is it possible to set up NTP Server using name address instead of IP address?

Wed Jun 16, 2021 11:57 pm

If you work, and not just play for yourself, the right strategy is use your own nation official atomic clock ntp server, not to read advise on third websites.
 
User avatar
Berlis
just joined
Topic Author
Posts: 5
Joined: Sun Apr 18, 2021 4:11 pm
Location: Poland

Re: Is it possible to set up NTP Server using name address instead of IP address?

Thu Jun 17, 2021 1:16 am

No offence, but it looks like You know nothing on a subject. If You did, You would know that recommendation I mentioned before was from official sites. It's on USA website as well as on PL, and i bet You could find it on other websites too.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Is it possible to set up NTP Server using name address instead of IP address?

Thu Jun 17, 2021 1:49 am

some link to this websites (please on english if possible)?

I'm not offending, but you do not do my work, I'm a WISP, or you do your work on wrong way,
because if you lean on dns name of third party on tp-link device instead to set YOUR IP (or YOUR DNS like ntp.mycompanyname.net, is not that the point) inside and use YOUR OWN NTP Server, probably you just install AP for someone than be one ISP.

My choice:
ntp.mycompanyname.net -> my primary NTP server
ntp1.mycompanyname.net -> my primary NTP server
ntp2.mycompanyname.net -> my secondary NTP server
nntp.mycompanyname.net -> National primary NTP server
nntp1.mycompanyname.net -> National primary NTP server
nntp2.mycompanyname.net -> National secondary NTP server
I have everytime the contol on what are set on the devices inside my network, using IP or DNS no matter.
Also on DHCP Server I use that values passed to clients
Last edited by rextended on Tue Jun 29, 2021 10:32 am, edited 1 time in total.
 
felodimul
just joined
Posts: 11
Joined: Wed Aug 12, 2020 5:59 pm

Re: Is it possible to set up NTP Server using name address instead of IP address?

Thu Jun 17, 2021 2:34 am

In SNTP Client, you can use "Server DNS Names" to enter a domain name, like pool.ntp.org .

https://help.mikrotik.com/docs/pages/vi ... d=40992869
 
RoyT
just joined
Posts: 4
Joined: Fri May 08, 2020 7:09 am

Re: Is it possible to set up NTP Server using name address instead of IP address?

Thu Jun 17, 2021 6:05 am

Yes - 7.1beta6 feature.

Proof:
You do not have the required permissions to view the files attached to this post.
 
scampbell
Trainer
Trainer
Posts: 487
Joined: Thu Jun 22, 2006 5:20 am
Location: Wellington, NZ
Contact:

Re: Is it possible to set up NTP Server using name address instead of IP address?

Sun Jun 20, 2021 6:18 am

Yes - 7.1beta6 feature.

Proof:
Also on RoS 6.48.3 and earlier
sntp.png
You do not have the required permissions to view the files attached to this post.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: Is it possible to set up NTP Server using name address instead of IP address?

Sun Jun 20, 2021 12:13 pm

The problem with RouterOS version 6 is that when you install the optional NTP server package, it also replaces the SNTP client, and the new NTP client is much more limited... (only 2 server addresses, only as literal IP address and not as DNS name).
In RouterOS version 7 that problem is no longer present, as the server is now part of the standard install and the supplied client is much more flexible.
It can use several servers and they can be specified as IP address or DNS.

It is unfortunate that the development of RouterOS v7 is sooooooo slooooowwww... we get a new beta every couple of months and it is so far from production ready.
So you will have to live with this NTP limitation for some time.
 
aesmith
Member Candidate
Member Candidate
Posts: 264
Joined: Wed Mar 27, 2019 6:43 pm

Re: Is it possible to set up NTP Server using name address instead of IP address?

Mon Jun 28, 2021 5:56 pm

With the NTP package you can create a timed script that resolves the host names and re-writes the IP addresses configured for NTP. A search will find examples. I had this one, but then I learned that with the build in client, it's not needed anyway ..
{
:local ntpServer1 "0.uk.pool.ntp.org"
:local ntpServer2 "1.uk.pool.ntp.org"
:local primary [resolve $ntpServer1]
:local secondary [resolve $ntpServer2]

/system ntp client set enabled=yes primary-ntp=$primary secondary-ntp=$secondary
}
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Is it possible to set up NTP Server using name address instead of IP address?

Mon Jun 28, 2021 6:00 pm

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

https://www.pool.ntp.org/zone
 
aesmith
Member Candidate
Member Candidate
Posts: 264
Joined: Wed Mar 27, 2019 6:43 pm

Re: Is it possible to set up NTP Server using name address instead of IP address?

Mon Jun 28, 2021 6:24 pm

That works with the built-in SNTP client, but (as I understand it) not with the add-on NTP package. Or not until RoS 7. As noted in the post before mine.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Is it possible to set up NTP Server using name address instead of IP address?

Mon Jun 28, 2021 6:27 pm

"Why complicate things..."
is for short 5 commands on only clear one....


This command are identical for both default (s)NTP and with NTP package installed on 6.46.8+ versions, I do not know if it work on 7.+
 
User avatar
Berlis
just joined
Topic Author
Posts: 5
Joined: Sun Apr 18, 2021 4:11 pm
Location: Poland

Re: Is it possible to set up NTP Server using name address instead of IP address?

Tue Jun 29, 2021 12:07 am

No offence, but it looks like You know nothing on a subject. If You did, You would know that recommendation I mentioned before was from official sites. It's on USA website as well as on PL, and i bet You could find it on other websites too.
some link to this websites (please on english if possible)?

Not a problem:
https://nrc.canada.ca/en/certifications ... otocol-ntp
https://tf.nist.gov/tf-cgi/servers.cgi
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Is it possible to set up NTP Server using name address instead of IP address?

Tue Jun 29, 2021 10:35 am

Thanks
 
aesmith
Member Candidate
Member Candidate
Posts: 264
Joined: Wed Mar 27, 2019 6:43 pm

Re: Is it possible to set up NTP Server using name address instead of IP address?

Wed Jun 30, 2021 6:27 pm

"Why complicate things..."
is for short 5 commands on only clear one....
Sorry I think I misunderstood - you mean simplify the script, I thought you meant it could be done without the script.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Is it possible to set up NTP Server using name address instead of IP address?

Wed Jun 30, 2021 6:45 pm

I have noticed :P

Who is online

Users browsing this forum: svh79 and 43 guests