"The Linux Gazette...making Linux just a little more fun!"

(?) The Answer Guy (!)

By James T. Dennis, tag@lists.linuxgazette.net
Starshine Technical Services, http://www.starshine.org/

(?) How 'ntpdate' finds IP addresses?

From Pete O'Donnell on Tue, 23 Feb 1999

(?) In an article on setting system clocks to atomic clock time, you referred to the following line:

/usr/sbin/ntpdate -s ntp.ucsd.edu ns.scruz.net ntp1.cs.wisc.edu

Do these 3 servers have entries in the /etc/ntp.conf file or is there some sort of host file set up on your machine? How does the xntpd daemon find the corresponding IPs. Let me know. Thanks answer guy.

-Pete O'Donnell

(!) The /etc/ntp.conf file is used by xntpd --- not be by the ntpdate command. The 'ntpdate' command finds IP addresses that correspond to these host names in the same way that any other Unix utility or application does. Almost all Unix utilities that do any sort of network operation are linked against a set of "resolver" libraries. The "resolver" libraries differ a bit among systems --- but most of them look in the /etc/hosts file, for a hostname match (grabbing an IP address from there if they find one) and then read the /etc/resolv.conf file for a list of nameservers (DNS). In other cases your resolver libraries might make requests (RPCs?) of one or more NIS (YP) servers in your NIS domain, and newer configurations --- using glibc's modular NSS (name services switching) as controlled by /etc/nsswitch.conf might query LDAP, NDS (Novell) or other backend directory/name services systems for their mapping.
(Under libc5 there was a /etc/hosts.conf that gave more limited and less extensible control over which name services were/are queried and in which order).
Read the man pages for those files (/etc/hosts, /etc/nsswitch.conf, /etc/hosts.conf and /etc/resolv.conf) for some details. You can also look at http://www.openldap.org for some cool info about future use/deployment of LDAP.

Copyright © 1999, James T. Dennis
Published in The Linux Gazette Issue 38 March 1999

[ Answer Guy Index ] 1 2 3 4 5 6 7 8 9 10 11
12   14   16 17 18 19   21 22
23 24   26   28 29 30 31 32  

[ Table Of Contents ] [ Front Page ] [ Previous Section ] [ Next Section ]