Operating System - Linux
1827435 Members
5130 Online
109965 Solutions
New Discussion

ntpq -p "Name or service not known"

 
Donny Jekels
Respected Contributor

ntpq -p "Name or service not known"

Ok, sometimes even the easy things get messed up and don't want to work regardless of what you do.

On my clients the /etc/ntp.conf has only one line in it.
server 10.20.20.52

if I run ntpd -d (in debug mode) it doesnt core dump and more importantly, it gets teh time tics and sets the local clock correctly.

However if I run ntpq -p on the box I get "Name or service not known"

ntp is listed in /etc/services
ntp 123/tcp
ntp 123/udp

any help in this regard would be very welcome.
Donny
"keep warm"
"Vision, is the art of seeing the invisible"
3 REPLIES 3
Alexander Chuzhoy
Honored Contributor

Re: ntpq -p "Name or service not known"

check if the file is in place (/usr/sbin/ntpq)
otherwise reinstall the ntp package.
Regards.
Ivan Ferreira
Honored Contributor

Re: ntpq -p "Name or service not known"

You can try using strace to try to find out where is the problem.

You can use rpm -V to verify the ntp package.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Donny Jekels
Respected Contributor

Re: ntpq -p "Name or service not known"

and you would think this will work in linux.

/etc/nsswitch.conf

hosts dns [NOTFOUND==continue] files

with the above setup ping localhost return host not found even if its listed in the hosts file.s

even though the above is a perfect solution to ensure no hosts entries are followed as depicted in dns.

I had to remove the NOTFOUND statement.
now it works.
"Vision, is the art of seeing the invisible"