1833144 Members
3045 Online
110051 Solutions
New Discussion

Configuration NTP

 
Jose Zamora
Occasional Contributor

Configuration NTP

NTP
---
I cannot cause that my server synchronizes with an NTP Time Server (internet).
The file ntp.conf has :

server 1.south-america.pool.ntp.org
server 0.pool.ntp.org
server 2.pool.ntp.org

and the exit of the commando ntpq is:

remot refid st t when poll
===========================================
inmunotron.med. 0.0.0.0 16 - - 64
graphite.hyperc 0.0.0.0 16 - - 64
shrewd.pub.knig 0.0.0.0 16 - - 64


reach delay offset disp
===========================================
0 0.00 0.000 16000.0
0 0.00 0.000 16000.0
0 0.00 0.000 16000.0


I thank for its aid and opinions.
Greetings

JOSE ZAMORA
2 REPLIES 2
Bill Hassell
Honored Contributor

Re: Configuration NTP

It appears that your machine does not have DNS resolving the hostnames. This is seen in the ntpq command where the IP address (refid) is all zeros. Test this with the nslookup command:

nslookup 1.south-america.pool.ntp.org

If you do not get an IP address (or several addresses) then your DNS server is not working correctly. Try this:

nslookup 200.43.64.77

and

ntpq -p 200.43.64.77

If the first fails, you have DNS problems. If the second command returns something like this:

remote refid st t when poll reach
=====================================================
*GENERIC(0) .GPS. 0 l 35 64 377
host3.200-43-14 octant.coopvgg. 2 u 788 1024 377
xadsl.remco.org .PG0A. 1 u 847 1024 377

then you can try using 200.43.64.77 by IP address in your /etc/ntp.conf file:

server 200.43.64.77

Now use ntpq -p (with no server name) to verify that your local NTP code can see the server. If that works, you are ready to 'jump' the time to match this server. Shutdown any applications that might be affected by changing the time. When ready, use this command:

ntpdate -b 200.43.64.77

If this produces no error, you can now start xntpd:

xntpd

Then monitor syslog.log and after an hour or so, check ntpq with:

ntpq -p

That should get you started. You will want to fix the DNS problems so nslookup works correctly. Then you can switch back to your current ntp.conf file.


Bill Hassell, sysadmin
Steven E. Protter
Exalted Contributor

Re: Configuration NTP

Shalom,

Either set the numeric ip addresses in ntp.conf or set /etc/hosts networking to resolve those ip addreses.

Most shops today have a single time server inside and do not permit access behind the firewall to individual servers. You may need to connect to an internal server.

Obviously the above steps can be avoided by changing /etc/resolv.conf to a server that resolves hostnames to numbers.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com