3

As a linux (Debian-based) host on a network, how can I discover whether an NTP service exists somewhere locally on the network? Thanks.

ChaimKut
  • 191
  • 4
  • 9

2 Answers2

3

There is a DHCP option for that if you configure the networking dynamically on the host.

If not, there is anycast: http://www.gsp.com/cgi-bin/man.cgi?topic=ntp.conf#19

if not, you can script nmap to scan the ntp ports, then try to ntpdate from open ports and if the host answers, add them to your config.

However, I wouldn't do that. ever. This can pickup misconfigured servers. Your time source should be reliable and not just "anything".

2

You can do this only if there is equipment which multicasts the time on the network. In this case, NTP will receive the time and use it. But if there is a server without multicast, it will answer a request. So you can do a network scan, but it is may be prohibited by the use policy in your organization.

The best possibility : ask your administrator! It's his job!

Deer Hunter
  • 1,070
  • 7
  • 17
  • 25
Dom
  • 6,743
  • 1
  • 20
  • 24