Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to setup the NTP server on Ubuntu machine. Am breaking my head in this particular issue.

Getting an error ntpdate[5005]: no server suitable for synchronization found when doing the command ntppdate.

Can anyone please help me out in this?


/etc/ntp.conf:

server 0.ubuntu.pool.ntp.org 
server 1.ubuntu.pool.ntp.org 
server 2.ubuntu.pool.ntp.org 
server 3.ubuntu.pool.ntp.org

Also when I gave command netstat -anltp | grep "LISTEN"

tcp    0   0 127.0.0.1:53            0.0.0.0:*         LISTEN   1816/dnsmasq
tcp    0   0 0.0.0.0:22              0.0.0.0:*         LISTEN   939/sshd
tcp    0   0 127.0.0.1:631           0.0.0.0:*         LISTEN   1013/cupsd
tcp    0   0 127.0.0.1:39558         0.0.0.0:*         LISTEN   5529/rsession
tcp    0   0 0.0.0.0:902             0.0.0.0:*         LISTEN   1275/vmware-authdla
tcp    0   0 127.0.0.1:47304         0.0.0.0:*         LISTEN   5822/rsession
tcp6   0   0 :::80                   :::*              LISTEN   1400/apache2
tcp6   0   0 :::22                   :::*              LISTEN   939/sshd
tcp6   0   0 ::1:631                 :::*              LISTEN   1013/cupsd

So what should I do so that it listens on 123?

If I get output as

PORT    STATE SERVICE
123/udp open  ntp

If I give command nmap -p 123 -sU -P0 192.168.36.198, it means UDP is open right? Then why doesn't it show in the command to to show listening ports?

share|improve this question
1  
Possible helpful topics on AU: askubuntu.com/questions/49401/… Also: NTP uses UDP. Can you check that your firewall allows outbound UDP packets on port 123? –  Rinzwind Aug 27 '12 at 6:39
2  
Can you add both to your question and remove the comments? :) netstat -anltp | grep "LISTEN" should show which ports are open. –  Rinzwind Aug 27 '12 at 7:57
    
I gave command "sudo ufw allow 123/udp" to allow the udp access to port 123 ,but it still didnt work .. –  Anups Aug 27 '12 at 8:42
1  
Have you looked at: askubuntu.com/questions/148187/… –  david6 Aug 27 '12 at 9:22
1  
Post output from 'ntpq -c rl'. –  david6 Aug 27 '12 at 10:10
show 4 more comments

4 Answers

You may be being blocked from reaching ubuntu.pool.ntp.org


Try a different NTP server pool.

Ask your ISP (or Network Administrator) for a local NTP server (or cluster).

share|improve this answer
add comment

If you want to sync with external time ref you don't have to "listen".

Check if you can reach 0.ubuntu.pool.ntp.org (ping and nmap -p 123 -sU 0.ubuntu.pool.ntp.org)

share|improve this answer
add comment

This error appears when the ntp server tries to syncronize the local time using remote servers.

Check if your machine has Internet access and the port 123/UDP is not blocked:

If you want a ntp server without internet access you must not define servers at your ntp.conf file, you can comment it adding a # at the start of the line:

#server 0.ubuntu.pool.ntp.org 
#server 1.ubuntu.pool.ntp.org 
#server 2.ubuntu.pool.ntp.org 
#server 3.ubuntu.pool.ntp.org

You can get more info at: http://support.ntp.org/bin/view/Support/WebHome

share|improve this answer
add comment

I have give a detailed answer from top to bottom. You might want to skip to middle of my answer or just refer the screenshots below for understanding it in a glance.

You need to configure ntp with servers as follows:

You should at least set following parameter in /etc/ntp.conf config file: server

For example, open /etc/ntp.conf file using nano text editor:

  sudo nano /etc/ntp.conf

Locate server parameter and if it is empty set it as follows:

  server pool.ntp.org

But usually In ubuntu already some servers are prewritten which might be

server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org

enter image description here

Save the file and restart the ntpd service:

   /etc/init.d/ntpd start

You can synchronize the system clock to an NTP server immediately with following command:

   sudo ntpdate pool.ntp.org

or just run already servers are defined

sudo ntpdate 0.ubuntu.pool.ntp.org

or other servers that are defined using server

generally

sudo ntpdate <one of the servername in /etc/ntp.conf>

BUT after that there is a chance you get the Error NTP socket in use as shown below:

enter image description here

In that case just run

ntpdate -u pool.ntp.org 

to update when ntp deamon is running

OR just stop the deamon,update and start it again as follows:

$ sudo ntpdate pool.ntp.org
$ sudo service ntp stop
$ sudo ntpdate pool.ntp.org
$ sudo service ntp start

and you will get

enter image description here

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.