NTP server name and ip details on Linux/Solaris | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

NTP server name and ip details on Linux/Solaris

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 05-12-2013
sanzee007 sanzee007 is offline
Registered User
 
Join Date: Apr 2013
Last Activity: 30 September 2014, 2:38 AM EDT
Posts: 23
Thanks: 1
Thanked 0 Times in 0 Posts
NTP server name and ip details on Linux/Solaris

Hi All,
Where can I find all the NTP server names/ip addresses on Linux/Solaris systems. How can I grep these names/IP address from specific files from a specific OS (Linux/Solaris).
I know on linux /etc/ntp.conf and /etc/ntp/ntp.conf on solaris contains these details. Whether I am right about these files or which other files can contain these details.?

Thanks in advance for your valuable inputs.
Sponsored Links
    #2  
Old 05-13-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 21 November 2014, 7:36 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,522
Thanks: 8
Thanked 555 Times in 532 Posts
Usually, you ntp off the nearer gov sites like USNO, or a corporate or site standard that chains back to same. Is your dilemma how to configure a client to listen, or how to configure server to listen to his master sources and serve clients? Often a firewall does this function, as it is on the Internet and can hit gov servers and provide time to the inside.
Sponsored Links
    #3  
Old 05-14-2013
sanzee007 sanzee007 is offline
Registered User
 
Join Date: Apr 2013
Last Activity: 30 September 2014, 2:38 AM EDT
Posts: 23
Thanks: 1
Thanked 0 Times in 0 Posts
Hi,
Say if the NTP is configured on a system, how can I fetch the ntp server and IP address from any system conf file? Is there any hostname gievn to the ntp server along with the IP address?
I am not worried about how the server/client is configured. I just want if ntp is set up on a system, how to get the ntp server name and ip address.

thanks for your reply.
    #4  
Old 05-14-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 21 November 2014, 7:36 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,522
Thanks: 8
Thanked 555 Times in 532 Posts
NTP servers come in many forms, but usually the configuration can be read. If configured with IP, do an nslookup to see if it reverses. I cannot say whether name or IP is more reliable, but usually a name is used, so there can be multiple IP supporting the name. If you do not have infrastructure guys to tell you what the internal NTP is, you may need to use an Internet one. My ntp is xntpd, and the default config is /etc/ntp.conf, but I cannot open it. However, 'ntpq -dp -ccooked' shows me three time servers! My windows internet time has an amazing huge list of servers, protocols.

A system that gets time, but does not serve time to the network, is a client. It just needs a server or two to call periodically to keep the clock in sync.
Sponsored Links
    #5  
Old 05-14-2013
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
who?
 
Join Date: Dec 2003
Last Activity: 24 November 2014, 3:41 PM EST
Location: /dev/ph
Posts: 4,836
Thanks: 64
Thanked 434 Times in 402 Posts
Quote:
Originally Posted by sanzee007 View Post
Hi,
I just want if ntp is set up on a system, how to get the ntp server name and ip address.
One approach would be to parse the ntp.conf file. Typically you will have more than one FQDN or IPv4/v6 address there. A problem with this approach is that if ntp.conf points to a NTP pool, it is not going to tell you which time servers your system is actually using. In that case , you will have to parse the output of the ntpq command.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Setting up NTP HP-UX clients from solaris NTP server fretagi HP-UX 3 04-17-2012 09:20 AM
How often does Linux NTP server update its time with the external NTP server? MichaelLi Linux 1 03-25-2011 10:43 AM
configuring NTP in Solaris/Windows/Linux environment. sgand UNIX for Advanced & Expert Users 3 04-15-2009 08:41 AM
connecting UNIX/Linux to NTP server learn82 UNIX for Advanced & Expert Users 1 04-10-2008 10:00 AM
connect linux to ntp server alkingg Gentoo 1 01-21-2008 09:15 AM



All times are GMT -4. The time now is 09:40 PM.