Monday, January 11, 2021

localhost: timed out, nothing received while running ntpq -p

 I was trying to configure NTP in my Oracle Linux 7 Server. The content of /etc/ntp.conf file was

server NTP_server_1

server NTP_server_2

server NTP_server_3

server  127.127.1.0

fudge   127.127.1.0 stratum 10

driftfile /var/lib/ntp/drift

restrict default nomodify notrap nopeer noquery


Changed the firewall

[root@apps etc]# firewall-cmd --zone=public --add-service=ntp

success

[root@apps etc]# firewall-cmd --zone=public --permanent --add-service=ntp

success

[root@apps etc]# systemctl start ntpd
[root@apps etc]# systemctl enable ntpd


Now, when i tried to run ntpq -p, got the below error

Error Message:-
localhost: timed out, nothing received
***Request timed out


Solution:-
The error message indicates that the ntpq command can not access localhost.localdomain, it means the localhost can not access the local ntpq service.

The restrict option in /etc/ntp.conf allows you to control which machines can access your server.

added the below line in /etc/ntp.conf file.

[root@apps etc]# grep 127.0.0.1 /etc/ntp.conf
restrict 127.0.0.1


[root@apps etc]# service ntpd restart
Redirecting to /bin/systemctl restart ntpd.service


[root@apps etc]# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*LOCAL(0)        .LOCL.          10 l   12   64    1    0.000    0.000   0.000



4 comments:

  1. Keep up the good work , I read few posts on this web site and I conceive that your blog is very interesting and has sets of fantastic information. writing software

    ReplyDelete
  2. What should you care about when you choose Delta-10 THC Vape Cartridge and disposable? here are the details about Delta-10 THC, suitable vape cartridge and disposable vape pen. Read more at delta 10 thc vape cartridge

    ReplyDelete
  3. Please feel free to contact us in the most convenient way for you either using email or by filling out the enquire form. We would be happy to answer your question and set up a meeting with you.
    nextclippingpath

    ReplyDelete
  4. Delta-10 THC Vape Cartridge carts are easy, convenient, and portable. Vape carts go wherever you go. Stick them in your purse or pocket and partake at a party or park.

    ReplyDelete