System Administration Guide

Adding Access to a Remote Printer Using a Name Service

Using either the NIS or NIS+ maps, access to a printer may be obtained on a domain-wide basis. See nis+(1).

How to Add Domain-Wide Access to a Printer using NIS

On the NIS master server, run the lpset command to create a printers.conf file; then create and push the map. This gives all members of the domain access to the printers defined in the map. See lpset(1M).

  1. Become superuser on the NIS master server.

  2. Create a printers.conf file by using the lpset command for each printer.


    # lpset -a bsdaddr=server1,printer1,extensions printer1
    
    -a bsdaddr=server1,printer1,extensions
    

    Adds the print server, printer destination, and enables Solaris protocol extensions. 

    printer1

    Specifies the printer name. 

  3. Create and push the NIS map.


    # make -f /var/yp/makefile -f /usr/lib/print/Makefile.yp 
    printers.conf
    
    -f /var/yp/makefile

    Specifies the NIS makefile. 

    -f /usr/lib/print/Makefile.yp

    Specifies the NIS print makefile. This means implicit rules and predefined macros from both makefiles are concatenated. 

    printers.conf

    Specifies the file to be created or updated. 

Example--Adding Domain-Wide Access to a Printer using NIS

This example creates a printers.conf entry for the printer luna, connected to the print server, saturn. The make command pushes the printers.conf map.


# lpset -a bsdaddr=saturn,luna,Solaris -a description=
"Room 1954 ps" luna
# make -f /var/yp/makefile -f /usr/lib/print/Makefile.yp 
printers.conf

How to Add Domain-Wide Access to a Printer using NIS+

On the NIS+ master server, use the lpset command (see lpset(1M)) to add the printer configuration information to NIS+ via XFN (see fns(5)).

  1. Become superuser on the NIS+ master server.

  2. (Optional) If FNS has not been initialized, create the root organization context and its subcontents for the NIS+ root domain.


    # fncreate -t org org//
    
  3. Create the NIS+ map.


    # lpset -n fns -a bsdaddr=server1,printer1,extensions printer1
    
    -n fns

    Creates or updates the FNS content. 

    -a bsdaddr=server1,printer1,extensions
    

    Adds the print server, printer destination, and enables Solaris protocol extensions. 

    printer1

    Specifies the printer name. 

Example--Adding Domain-Wide Access to a Printer using NIS+

This example creates a printers.conf entry for the printer luna, connected to the print server, saturn.


 
# lpset -n fns -a bsaddr=saturn,luna,Solaris -a description=
"Room 1954 ps" luna