<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gHacks technology news &#187; ntp</title>
	<atom:link href="http://www.ghacks.net/tag/ntp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Tue, 24 Nov 2009 20:14:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Installing and Configuring NTP on Linux</title>
		<link>http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/</link>
		<comments>http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 14:07:04 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[ntp]]></category>
		<category><![CDATA[ntp.org]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[time server]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=11255</guid>
		<description><![CDATA[NTP is the Network Time Protocol. This protocol allows servers (or desktops) to communicate to very reliable sources to keep their time synchronized. There are two reasons why you would want to employ NTP: 1) You&#8217;re a geek and you want your time to be perfect. 2) You need your servers all synchronized with the [...]]]></description>
			<content:encoded><![CDATA[<p>NTP is the Network Time Protocol. This protocol allows servers (or desktops) to communicate to very reliable sources to keep their time synchronized. There are two reasons why you would want to employ NTP: 1) You&#8217;re a geek and you want your time to be perfect. 2) You need your servers all synchronized with the correct time.</p>
<p>Naturally the second reason is far more important than the first. But either way, you might very well be driven to keep your machine on the exact time. To that end you can either constantly monitor the time on your machine (manually changing it when necessary) or you can set up NTP to handle your time corrections for you.</p>
<p>Installing and configuring NTP is actually quite easy. It will, however, require the use of the command line. With that in mind, lets&#8217; get busy.</p>
<p><span id="more-11255"></span><strong>Installing</strong></p>
<p>You could open up your Add/Remove Software utility, do a search for &#8220;ntp&#8221; (no quotes) and install the matching results. Or you can open up a terminal window and install ntp with one of the following commands (remember, you will need either root access or sudo):</p>
<ul>
<li><em>apt-get install ntp </em></li>
<li><em>yum install ntp<br />
</em></li>
<li><em>urpmi ntp</em></li>
</ul>
<p>One of the above commands will install the ntp daemon and the configuration file <strong>/etc/ntp.conf</strong>.</p>
<p>Before you fire up the daemon you will need to take a look at the <strong>/etc/ntp.conf </strong>to make sure you have the ntp servers you want to use configured.</p>
<p><strong>Configuring</strong></p>
<p>Most likely your NTP installation will already have a configuration file that is ready to go. My Debian-based NTP install had such a .conf file. All I had to do was start the daemon. But you might have special needs or your install might not have been as complete.</p>
<p>The section of the <strong>ntp.conf</strong> that you will want to take a look at is the server section. Each line in this section is set up like so:</p>
<p><em>server IP_ADDRESS OPTION(S)</em></p>
<p>Where<em> IP_ADDRESS</em> is the actual address of the server you want to use and <em>OPTION(S)</em> is/are the option(s) you want to use.</p>
<p>There are two options that you might want to use for every server. These are:</p>
<p><strong>iburst</strong>: This option is used when the configured server is unreachable. When your machine can not contact its NTP server it will send out bursts of eight packets (instead of just one).</p>
<p><strong>dynamic</strong>: This option allows a server to be configured even if the server is not reachable during configuration. This option assumes that at some point the server will be reachable.</p>
<p>If you look at my <strong>/etc/ntp.conf</strong> file you will see the following in the server section:</p>
<p><code>server 0.debian.pool.ntp.org iburst dynamic<br />
server 1.debian.pool.ntp.org iburst dynamic<br />
server 2.debian.pool.ntp.org iburst dynamic<br />
server 3.debian.pool.ntp.org iburst dynamic</code></p>
<p>If you are not sure what servers to use visit the official NTP organization <a title="NTP.org" href="http://www.ntp.org" target="_blank">NTP.org</a> to find a list of trusted servers.</p>
<p><strong>Starting the Daemon</strong></p>
<p>Once you have everything up and running go back to the root terminal and issue the command:</p>
<p><em>/etc/init.d/ntp start</em></p>
<p>or</p>
<p><em>/etc/rc.d/init.d/ntp start</em></p>
<p>which will start the ntp daemon. NTP will now slowly start to adjust the time on your server. But don&#8217;t worry, it makes the adjustment slowly. First the daemon waits for at least ten packets of information before trusting a source.</p>
<p>Now test to make sure your installation is working by issuing the following command:</p>
<p><em>ntpq -p</em></p>
<p>which should give you a listing like:<br />
<code>remote           refid      st t when poll reach   delay   offset  jitter =========================================================<br />
+point2.adamants 64.202.112.75    2 u   44   64  377   75.955   -7.045   2.992<br />
*station.mars.or 209.81.9.7       2 u   10   64  377   75.477   -1.144   0.977<br />
-www.broadbandja 64.34.180.101    3 u   56   64  377   72.764    3.766   0.977<br />
+pxe.lax-noc.com 209.81.9.7       2 u   25   64  377   65.686   -7.753   2.539</code></p>
<p>If you see zeros for the values you know ntp is not connecting. As you can see above my setup is connecting.</p>
<p><strong>Final thoughts</strong></p>
<p>NTP is an easy way to ensure your servers or your desktop is always using the correct time. In mission-critical machines, this can be quite important. Employing NTP will give you the security of knowing your machine&#8217;s right &#8220;on time&#8221;.</p>

	Tags: <a href="http://www.ghacks.net/tag/clock/" title="clock" rel="tag">clock</a>, <a href="http://www.ghacks.net/tag/debian/" title="Debian" rel="tag">Debian</a>, <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.ghacks.net/tag/ntp/" title="ntp" rel="tag">ntp</a>, <a href="http://www.ghacks.net/tag/ntporg/" title="ntp.org" rel="tag">ntp.org</a>, <a href="http://www.ghacks.net/tag/time/" title="time" rel="tag">time</a>, <a href="http://www.ghacks.net/tag/time-server/" title="time server" rel="tag">time server</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2008/12/11/thoughts-on-linux-migration/" title="Thoughts on Linux migration (December 11, 2008)">Thoughts on Linux migration</a> (16)</li>
	<li><a href="http://www.ghacks.net/2009/03/26/easy-debian-wireless-connections-with-wifi-wiz/" title="Easy Debian Wireless Connections with Wifi-Wiz (March 26, 2009)">Easy Debian Wireless Connections with Wifi-Wiz</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/03/08/adding-repositories-to-synaptic/" title="Adding Repositories to Synaptic (March 8, 2009)">Adding Repositories to Synaptic</a> (1)</li>
	<li><a href="http://www.ghacks.net/2008/02/07/yoggie-pico-personal-mobile-security-computer/" title="Yoggie PICO Personal Mobile Security Computer (February 7, 2008)">Yoggie PICO Personal Mobile Security Computer</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/10/30/with-ubuntu-9-10-arrives-wubi-9-10/" title="With Ubuntu 9.10 Arrives Wubi 9.10 (October 30, 2009)">With Ubuntu 9.10 Arrives Wubi 9.10</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
