It would help if you stated what distro you are using. Generally you would install the ypbind and ypserv packages, modify /etc/ypbind.conf and /etc/ypserv.conf as needed, and go. The main makefile for building the NIS databased is generally stored in /var/yp. You'll need to set some things up in it. I suggest not using the system passwd, shadow, and group files but keeping your own files somewhere else (I use /var/yp/files for this). Type make to build the maps, and go.
There's a lot more detail about this on the Web -- have you tried Google?