RobJ

Using NTP for accurate server time

16 posts in this topic Last Reply

Recommended Posts

As of unRAID v4.3, NTP is now included in unRAID.  As a new feature, it is turned off by default, but is very easy to turn on and use.  Go to the Settings tab of the Web Management page, then down to the Date and time section, and select Yes for Use NTP, and click the Apply button below.  That really is all you have to do!  The following is only for tweakers.

 

For those of us that like to fully understand our systems, and/or tweak them, I recommend going to http://www.pool.ntp.org/, to learn more about NTP and what to set the NTP Servers to.  unRAID defaults to pool.ntp.org, which works anywhere, but which provides a random time server from any where in the world.  A more efficient choice with less latency would be a time server that is as close as possible, although most would not find the difference in accuracy to be that noticeable, perhaps tenths of a second better.  But if you want to specify better and additional servers, enter a time server that is close, and/or select several from the continental zones page.  From that page, drill down to your country by selecting the continent first, then the country, then one or more of the servers listed.  For example, for anyone in the U.S., you might select 0.us.pool.ntp.org and 1.us.pool.ntp.org and 2.us.pool.ntp.org.  Now, instead of getting a random time server from the other side of the world, you will get one from somewhere in the U.S.

 

Note: I welcome correction and expansion from the Linux experts among us.

Share this post


Link to post

I just upgraded from 4.3-beta6 to 4.3.1 and noticed this feature.

 

I live in the midwestern US, so after enabling this feature, I set my time zone to (GMT-06:00) for Central Time. I also set the NTP servers to 1.us.pool.ntp.org, 2.us.pool.ntp.org, and 3.us.pool.ntp.org.

 

When I pick the Apply button it displays the wrong time. The current time in this zone is 8:08:xx PM and with the NTP server it is 7:08:xx. Why is it off by an hour? On my other PCs that are running Vista's or XP's date and time feature set to synchronize with 'time.nist.gov' the time is correct.

Share this post


Link to post

I just upgraded from 4.3-beta6 to 4.3.1 and noticed this feature.

 

I live in the midwestern US, so after enabling this feature, I set my time zone to (GMT-06:00) for Central Time. I also set the NTP servers to 1.us.pool.ntp.org, 2.us.pool.ntp.org, and 3.us.pool.ntp.org.

 

When I pick the Apply button it displays the wrong time. The current time in this zone is 8:08:xx PM and with the NTP server it is 7:08:xx. Why is it off by an hour? On my other PCs that are running Vista's or XP's date and time feature set to synchronize with 'time.nist.gov' the time is correct.

Probably because you did not yet install the "custom" timezone file.  You asked for GMT - 6, and that is exactly what you got... at this time of year, with daylight savings time, you want to go forward an hour... The GMT-6 does NOT do this, it simply offsets 6 hours, regardless of the date.  You can either choose GMT-5 and then switch back to GMT-6 in the fall or, install the correct "custom" timezone, and then choose "custom" as your time-zone.  It knows when to apply the daylight savings time offset. 

 

The timezone files are here: http://lime-technology.com/dnlds/timezone/America/

 

The instructions for installation are here: http://lime-technology.com/?page_id=47#toc-time-zone

 

Joe L.

Share this post


Link to post

In the US, for best (closest) time, I set my time-servers to:

 

1.  us.pool.ntp.org

 

2.  north-america.pool.ntp.org

 

3.  pool.ntp.org

 

This is based on the advice on the pool.ntp.org web-site.  This way, I use the time-servers closest to me from the pool.

 

Joe L.

Share this post


Link to post

I am having a problem where I set my timezone to GMT -5 yet on the command line date shows GMT +5. I tried changing it so something else and then back to no avail.  I don't need to download a custom timezone for GMT -5 do I?  I thought it was just for DST.

Share this post


Link to post

I am having a problem where I set my timezone to GMT -5 yet on the command line date shows GMT +5. I tried changing it so something else and then back to no avail.  I don't need to download a custom timezone for GMT -5 do I?  I thought it was just for DST.

You are innocently incorrect.  (I was too initially.)

 

GMT-5 timezone setting is GMT+5, you really want GMT+5 to get GMT-5.  (The point of reference is backward than most everywhere else. Think of yourself in England... from that point of reference,  GMT is +5 hours from EST.)

Even with that, daylight savings time is not accounted for.  So, try GMT+5 as the setting on the management screen if you do not care about daylight savings time, or download the appropriate "timezone" file and then select "custom" as the timezone if you don't want to mess with DST in the spring and fall.

 

Joe L.

Share this post


Link to post

... download the appropriate "timezone" file and then select "custom" as the timezone if you don't want to mess with DST in the spring and fall.

 

Joe L.

 

For Austria / Europe I just set the NTP Server 1 to "0.at.pool.ntp.org". To adjust DST instead of "GMT+1" I chose "GMT+2".

But what did Joe L. mean by appropriate "timezone" file?

 

EDIT: ok, I found this thread. Hope I can figure it out.

EDIT2: yippee! it's working!

Share this post


Link to post
Probably because you did not yet install the "custom" timezone file.  You asked for GMT - 6, and that is exactly what you got... at this time of year, with daylight savings time, you want to go forward an hour... The GMT-6 does NOT do this, it simply offsets 6 hours, regardless of the date.  You can either choose GMT-5 and then switch back to GMT-6 in the fall or, install the correct "custom" timezone, and then choose "custom" as your time-zone.  It knows when to apply the daylight savings time offset. 

 

The timezone files are here: http://lime-technology.com/dnlds/timezone/America/

 

The instructions for installation are here: http://lime-technology.com/?page_id=47#toc-time-zone

 

Joe L.

 

These links are no longer valid.  I arrived here from the wiki.  :)

 

Share this post


Link to post

Probably because you did not yet install the "custom" timezone file.  You asked for GMT - 6, and that is exactly what you got... at this time of year, with daylight savings time, you want to go forward an hour... The GMT-6 does NOT do this, it simply offsets 6 hours, regardless of the date.  You can either choose GMT-5 and then switch back to GMT-6 in the fall or, install the correct "custom" timezone, and then choose "custom" as your time-zone.  It knows when to apply the daylight savings time offset. 

 

The timezone files are here: http://lime-technology.com/dnlds/timezone/America/

 

The instructions for installation are here: http://lime-technology.com/?page_id=47#toc-time-zone

 

Joe L.

I think they are here, but odds are they are not needed. (If you are running a recent version of unRAID)

http://lime-technology.com/download/cat_view/55-utilities

 

These links are no longer valid.  I arrived here from the wiki.   :)

 

Share this post


Link to post

In the US, for best (closest) time, I set my time-servers to:

 

1.  us.pool.ntp.org

 

2.  north-america.pool.ntp.org

 

3.  pool.ntp.org

 

This is based on the advice on the pool.ntp.org web-site.  This way, I use the time-servers closest to me from the pool.

 

Joe L.

 

Im using this with Arizona time zone UTC-07:00 and its an hour ahead of what it should be i cant find a custom ntp for arizona. there is no day light savings time in my location..any other ideas? thanks

Share this post


Link to post

Im using this with Arizona time zone UTC-07:00 and its an hour ahead of what it should be i cant find a custom ntp for arizona. there is no day light savings time in my location..any other ideas? thanks

 

You should only have to select "(UTC-07) Arizona" at the Timezone prompt on the Settings page.  Do not use a custom timezone file, remove it if you have copied one to the config folder.  If that is still an hour off, then try selecting a Mountain time, then a Central or Pacific time, until your time is correct.  Without the custom timezone file with its special daylight-saving instructions, I believe your time will stay the same all year long.

Share this post


Link to post

If you have an NTP server on your local network, you can add it as a preferred NTP server in your UnRAID settings.  In one of the configurable NTP server fields, add the local IP of your machine running the NTP server software, plus the word 'prefer' (eg. 192.168.1.199 prefer).  If your NTP server is always on, and your UnRAID server is only occasionally on, then you don't need to fill in the other NTP servers.  But if it is possible that your UnRAID server might be up when your NTP server was not, then add the 2 additional NTP servers as backup.

 

I use the free Meinberg NTP Software, essentially a Windows compiled version of the open source NTP software.  It is always running on my main Windows machine, which is always running SageTV.  My UnRAID server is only up once in awhile, to save on power costs.

Share this post


Link to post

FYI... unRAID pulls time from my Windows domain controllers just fine.

Share this post


Link to post

Just wanted to make mention of an issue I resolved with NTP on unRaid so if others run into the same issue this might help.

The issue was when using a hostname in the NTP custom settings in unRaid, and checking the console with ntpq -p I was seeing that the host I entered was dwelling on the .INIT. state, and not actually syncing with my local NTP server.

 

It turns out, this was because the hostname I used resolves both an A and an AAAA entry (IPv4 / IPv6) and it was trying over IPv6 by default and failing.

When you make alterations to the custom NTP server fields in the web GUI and save, the system copies the template config from /etc/ntp.conf- appending the custom server entries at the bottom.
In this template file, I found near the bottom and commented out interface ignore ipv6.

Then, once I re-added my local NTP server's hostname in the web GUI and saved, the changed I made in the 'template' were applied and the ntpq -p revealed it was syncing properly and all was well.

Was there any particular reason to ignore ipv6 other than it's still gaining in popularity and not everyone uses it?

Perhaps moving forward should this line be excluded or commented for future releases?

Share this post


Link to post
Posted (edited)

The interface ignore ipv6 was added to force NTP on IPv4 only, but you make a good point that name resolving may end up in an IPv6 address.

 

Removing the statement will enable NTP IPv6 for ALL interfaces, and may give unwanted situations (e.g. when having multiple VLAN interfaces). It can be changed to enable NTP IPv6 on the management interface only (eth0/br0), I'll put that for the upcoming version.

 

Thanks for your observation.

Edited by bonienl

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Copyright © 2005-2018 Lime Technology, Inc.
unRAID® is a registered trademark of Lime Technology, Inc.