Syncing clock in FreeBSD
Keeping accurate time on a host (either a server or a workstation) is important because:
1- You need to know accurately when you should go for lunch or back home
2- You need accurate time in your event log files for further analysis
3- Many programs need to have the correct date and time to function (e.g. MTA)
4- You need correct timestamps on your files
Given above facts, you will need to enable NTP on your hosts and keep your system clock in sync with public time servers.
First you should make sure that your timezone setting is correct. The latest timezone information can be updated by installing “zoneinfo” port from /usr/ports/misc/zoneinfo:
# cd /usr/ports/misc/zoneinfo/
# make install clean
and run tzsetup(8) to make sure you have selected the correct timezone.
Now, to enable automatic time sync during system startup, you need to add a few lines to your /etc/rc.conf file:
ntpdate_enable="YES"
ntpdate_flags="-b pool.ntp.org"
This will make your system to sync the clock upon startup. I use NTP pool at “pool.ntp.org” that suggests a NTP server from a large pool of available time servers. However you may use your favorite/local NTP server.
You can also synchronize your time manually by invoking ntpdate(8) from command line, passing an NTP server address to it:
# ntpdate time.nist.gov
Archives
- April 2012
- July 2011
- December 2010
- September 2010
- May 2009
- April 2009
- February 2009
- September 2008
- April 2008
- February 2008
- January 2008
- November 2007
- October 2007
- August 2007
- July 2007
- May 2007
- February 2007
- December 2006
- October 2006
- September 2006
- April 2006
- March 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- April 2005
- March 2005
- January 2005
- December 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- April 2004
- March 2004
- February 2004
- January 2004
- December 2003
- November 2003
- October 2003
- September 2003
- August 2003
- July 2003
- June 2003
- May 2003
- April 2003
- March 2003
- February 2003



