Наши партнеры

Книги по Linux (с отзывами читателей)

Библиотека сайта rus-linux.net

Next: Getting Acquainted with NIS Up: The Network Administrators' Guide Previous: Configuring the r Commands

The Network Information System

When you are running a local area network, your overall goal is usually to provide an environment to your users that makes the network transparent. An important stepping stone to this end is to keep vital data such as user account information synchronized between all hosts. We have seen before that for host name resolution, a powerful and sophisticated service exists, being DNS. For others tasks, there is no such specialized service. Moreover, if you manage only a small LAN with no Internet connectivity, setting up DNS may not seem worth the trouble for many administrators.

This is why Sun developed NIS, the Network Information System. NIS provides generic database access facilities that can be used to distribute information such as that contained in the passwd and groups files to all hosts on your network. This makes the network appear just as a single system, with the same accounts on all hosts. In a similar fashion, you can use NIS to distribute the hostname information form /etc/hosts to all machines on the network.

NIS is based on RPC, and comprises a server, a client-side library, and several administrative tools. Originally, NIS was called Yellow Pages, or YP, which is still widely used to informally refer this service. On the other hand, Yellow Pages is a trademark of British Telecom, which required Sun to drop that name. As things go, some names stick with people, and so YP lives on as a prefix to the names of most NIS-related commands such as ypserv, ypbind, etc.

Today, NIS is available for virtually all , and there are even free implementations of it. One is from the BSD Net-2 release, and has been derived from a public domain reference implementation donated by Sun. The library client code from this release has been in the GNU libc for a long time, while the administrative programs have only recently been ported to by Swen Thümmler.gif An NIS server is missing from the reference implementation. Tobias Reber has written another NIS package including all tools and a server; it is called yps.gif

Currently, a complete rewrite of the NIS code called NYS is being done by Peter Eriksson,gif which supports both plain NIS and Sun's much revised NIS+. NYS not only provides a set of NIS tools and a server, but also adds a whole new set of library functions which will most probably make it into the standard libc eventually. This includes a new configuration scheme for hostname resolution that replaces the current scheme using host.conf. The features of these functions will be discussed below.

This chapter will focus on NYS rather than the other two packages, to which I will refer as the ``traditional'' NIS code. If you do want to run any of these packages, the instructions in this chapter may or may not be enough. To obtain additional information, please get a standard book on NIS, such as Hal Stern's NFS and NIS (see-[]).

For the time being, NYS is still under development, and therefore standard utilities such as the network programs or the login program are not yet aware of the NYS configuration scheme. Until NYS is merged into the mainstream libc you therefore have to recompile all these binaries if you want to make them use NYS. In any of these applications' Makefiles, specify -lnsl as the last option before libc to the linker. This links in the relevant functions from libnsl, the NYS library, instead of the standard C-library.

Next: Getting Acquainted with NIS Up: The Network Administrators' Guide Previous: Configuring the r Commands

Andrew Anderson
Thu Mar 7 23:22:06 EST 1996