Setting up FreeBSD as an NIS client

Setting up FreeBSD as an NIS client

This article was written by Eric Anderson.

So what if you want to use
your FreeBSD box as a client on a network that is running NIS?  Simple!  This
should walk you through most of the setup.   Of course, have FreeBSD 3.3 or greater
installed with your network settings already working before doing this.

Setting up the client

We are going to assume a few things about your setup.  Your NIS
domain is, and your NIS servers are nisserver1 (master) and nisserver2 (slave).
  Edit your /etc/rc.conf and add the following lines:


The spacing is important on some versions of FreeBSD, so be careful to keep the spacing

Now, edit your /etc/group file, and add a + to the end (last line). It should look
something like:


Editing name resolution order

Next, edit your /etc/host.conf file, and make sure you
uncomment nis, so it looks something like:

# $FreeBSD: src/etc/host.conf,v 1999/08/29 14:18:44 peter Exp $
# First try the /etc/hosts file
# Now try the nameserver next.
# If you have YP/NIS configured, uncomment the next line

Editing the hosts file

Edit your /etc/hosts file and make sure you have the local
machine, and both NIS servers in the list.  Add a +:: to the end (last line). It
should look something like this (you may not have to do this if you are a name server):

# $FreeBSD: src/etc/hosts,v 1999/08/29 14:18:44 peter Exp $
# Host Database
# This file should contain the addresses and aliases
# for local hosts that share this file.
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/host.conf for the resolution 
# order.
#      localhost     fridge      nisserver1      nisserver2

Editing the master.passwd file

Now do a vipw master.passwd, and add a +::::::::: to the end
(last line) of the file.  It should look something like this:

uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico
xten:*:67:67::0:0:X-10 daemon:/usr/local/xten:/sbin/nologin
pop:*:68:6::0:0:Post Office Owner:/nonexistent:/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/sbin/nologin

Do NOT edit the passwd file, and make sure you have the right number of :’s.  
Also, make sure you have the correct DNS settings in your /etc/resolv.conf

Leave a Comment

Scroll to Top