Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hi all I have an ubuntu8 server where I have problems with date. My current date (Europe/Rome) is 9:35 If I do date print me 11:12:34 I have seen my ntp.conf is:

    server 0.ubuntu.pool.ntp.org
    server 1.ubuntu.pool.ntp.org
    server 2.ubuntu.pool.ntp.org
    server 3.ubuntu.pool.ntp.org
    restrict -4 default kod notrap nomodify nopeer noquery
    restrict -6 default kod notrap nomodify nopeer noquery
    restrict 127.0.0.1
    restrict ::1
    restrict 192.168.1.0 mask 255.255.255.0 modify notrap

if I stop and start ntpdate return me this:

dpkg-reconfigure tzdata

I set:

Europe
Rome

and print me

Current default timezone: 'Europe/Rome'
Local time is now:      Thu Mar 28 11:16:06 CET 2013.
Universal Time is now:  Thu Mar 28 10:16:06 UTC 2013.

If I do date print me

Thu Mar 28 11:16:25 CET 2013

I have tried this:

/etc/init.d/ntp stop
ntpdate it.pool.ntp.org

Print me:

no server suitable for synchronization found

if I Check this:

netstat -antltp | grep "LISTEN"

tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      3114/mysqld
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      3295/vsftpd
tcp        0      0 109.233.120.149:53      0.0.0.0:*               LISTEN      2935/named
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      2935/named
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2988/sshd
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      3265/master
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      2935/named
tcp        0      0 0.0.0.0:1723            0.0.0.0:*               LISTEN      2969/openvpn
tcp6       0      0 :::53                   :::*                    LISTEN      2935/named
tcp6       0      0 :::22                   :::*                    LISTEN      2988/sshd
tcp6       0      0 ::1:953                 :::*                    LISTEN      2935/named

How can I set the right date? Thanks

share|improve this question
    
what is displayed in your /etc/timezone? Is this also Europe/Rome ? –  timmeyh Mar 28 '13 at 8:47
    
Yes is Europe/Rome @timmeyh –  Alessandro Minoccheri Mar 28 '13 at 8:48
add comment

2 Answers

up vote 1 down vote accepted

ntpd has some safety limits based on the size of the discrepancy between local time and network time. If the discrepancy is too big, ntpd won't update the time. So you better set the system time as correct as you can (after stopping ntpd) with:

/etc/init.d/ntp stop

date +%T -s "hh:mm:ss"

/etc/init.d/ntp start

This should hopefully fix the problem

share|improve this answer
    
Alternatively, use the ntpdate command to set the time correct as far as NTP thinks, and then restart ntp. eg: sudo ntpdate -uv 0.ubuntu.pool.ntp.org –  Daniel Lawson Mar 28 '13 at 8:56
    
Return me error 28 Mar 11:35:10 ntpdate[3897]: ntpdate 4.2.4p4@1.1520-o Fri Dec 4 18:18:35 UTC 2009 (1) 28 Mar 11:35:15 ntpdate[3897]: no server suitable for synchronization found @DanielLawson –  Alessandro Minoccheri Mar 28 '13 at 8:58
    
No isn't correct return me again at the old wrong time @timmeyh –  Alessandro Minoccheri Mar 28 '13 at 8:59
    
@AlessandroMinoccheri What does "ntpdate -u 3.debian.pool.ntp.org" returns? –  timmeyh Mar 28 '13 at 9:03
    
@timmeyh return me"no server suitable for synchronization found" –  Alessandro Minoccheri Mar 28 '13 at 9:04
show 8 more comments

A "no server suitable for synchronization found" error typically occurs when a firewall blocks the traffic. Make sure port 123 is open to incoming udp traffic on your machine.

Regarding netstat, UDP is stateless so you don't expect to find anything if you grep "LISTEN". And you don't expect to find any UDP connection with -t but no -u. Use netstat -ul or netstat -uln instead. Don't forget to restart your ntpd before you do that.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.