1

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

2
  • what is displayed in your /etc/timezone? Is this also Europe/Rome ?
    – timmeyh
    Mar 28, 2013 at 8:47
  • Yes is Europe/Rome @timmeyh Mar 28, 2013 at 8:48

2 Answers 2

2

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

13
  • 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 Mar 28, 2013 at 8:56
  • Return me error 28 Mar 11:35:10 ntpdate[3897]: ntpdate [email protected] Fri Dec 4 18:18:35 UTC 2009 (1) 28 Mar 11:35:15 ntpdate[3897]: no server suitable for synchronization found @DanielLawson Mar 28, 2013 at 8:58
  • No isn't correct return me again at the old wrong time @timmeyh Mar 28, 2013 at 8:59
  • @AlessandroMinoccheri What does "ntpdate -u 3.debian.pool.ntp.org" returns?
    – timmeyh
    Mar 28, 2013 at 9:03
  • @timmeyh return me"no server suitable for synchronization found" Mar 28, 2013 at 9:04
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .