LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 02-25-2007, 12:01 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 73
NTPDATE -vs- NTPd?


So I was looking to update my time and sync it with a NTP server via the web since my time is always wrong once my machine reboots for some strange reason. I can set in manually all day long but when I reboot the PC, it comes back wrong. I have checked the BIOS and it is correct.

Anyways, I was looking to understand what is the difference between installing "ntpdate" and the "ntpd" packages on my box? Obviously I don't want to dish out time to my LAN and other PC's so I would assume I don't want "NTPd" however when I try and sync my time via Gnome to a NTP server, it says I don't have NTP support installed and request I install it.

I have a time server on my LAN and it has an IP of 10.1.1.1 however what do I need on my box to enable the sync between the two?
 
Old 02-25-2007, 12:18 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,027
Blog Entries: 5

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
ntpd is a daemon that runs to keep your time up to date/time. For this you must configure ntp.conf so it will know where to get the date/time

ntpdate is a command that will use ntp.conf to do an update now as opposed to waiting for ntpd to do it.

Translation: You want ntpd, you need to configure ntp.conf. You CAN use ntpdate to do manual updates.

If you don't have your own device (e.g. a GPS ntp clock) you can point ntp.conf at a trusted site like the US Naval Observatory. When I installed Fedora Core 6 the other day I noticed Fedora has sites one can point too (presumably at RedHat - I didn't use them since we have our own ntp clock.

In addition to using NTP to keep your "system" clock up to date you may want to use hwclock to sync your hardware clock with your "system " clock. hwlcock --systohc will set your hwclock to your system clock's time.


By the way since you bring it up so close to DST changes in the U.S. and other places I'll mention that all the above has nothing to do with DST. The above deals with UTC (Universal Time a/k/a GMT or Zulu) which is the way Linux/UNIX store "system" time. DST deals with timezone which is the way Linux/UNIX display time.

If you're working on ntp trying to address DST then be advised you still have more work to do. NTP will not overcome a bad timezone because it only uses the UTC for the updates.
 
Old 02-25-2007, 01:52 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 73
I am looking at the "ntp.conf" file and I know NTP is working but I want ntp to be sync'ed from my provided NTP server and not the provided onces. Is there a way I can check to see what server my NTP is getting info from?

As you can see below I have pasted a small top section from my ntp.conf and I added my time server "10.1.1.1" however I am not sure if that was the right place and also if I should remove the provided examples below?

My NTP.CONF

# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example
server 10.1.1.1

# pool.ntp.org maps to more than 300 low-stratum NTP servers.
# Your server will pick a different set every time it starts up.
# *** Please consider joining the pool! ***
# *** <http://www.pool.ntp.org/join.html> ***
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
 
Old 02-25-2007, 03:05 PM   #4
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,027
Blog Entries: 5

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
The syncs when done are recorded in /var/log/messages.

You can comment out other servers and just add your own. That way you'll be sure it's not using any others. Make sure you update security settings as well. You should have server and restrict entries for each NTP source e.g.:

restrict 10.0.0.1 mask 255.255.255.255 nomodify notrap noquery
restrict 10.0.0.2 mask 255.255.255.255 nomodify notrap noquery
restrict 192.5.41.40 mask 255.255.255.255 nomodify notrap noquery

server 10.0.0.1
server 10.0.0.2
server 192.5.41.40


The 192.5.41.40 is the USNO I believe - the other two are obfuscated versions of our internal NTP clocks - you'd put your own IP addresses in place of these. Don't forget to stop/start ntpd after making the changes.

The debian stuff you show are presumably Debian's equivalent to Fedora's NTP servers.

Note: in the above none of the servers are the host itself - they are the NTP servers.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ntpdate gets reply from server, ntpd doesn't (confused!) Lindahl Linux - Software 5 06-20-2006 07:26 PM
ntpdate configuration? introuble Debian 5 03-26-2006 01:04 PM
NTPDATE will *NOT* work jon_k Linux - Software 8 01-02-2005 06:41 AM
ntpdate and port adcripps Linux - General 2 09-06-2002 05:38 AM
ntpdate installation. Oberon_sedai Linux - Newbie 1 12-06-2001 11:27 AM


All times are GMT -5. The time now is 06:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration