System Administration Guide: Printing

Printer Configuration Resources

The printing software uses certain resources to locate printer names and printer configuration information. The printer software may be configured to use a naming service to advertise the printers. The naming service can be used for storing printer configuration information for all printers on the network. The naming service, LDAP, NIS, or NIS+, simplifies printer configuration maintenance. When you add a printer in the naming service, all print clients on the network can access the printer.

Printing Support in the Naming Service Switch

The printers database in /etc/nsswitch.conf, the naming service switch file, provides centralized printer configuration information to print clients on the network.

By including the printers database and corresponding sources of information in the naming service switch file, print clients automatically have access to printer configuration information without having to add it to their own systems.

The default printers entry in the /etc/nsswitch.conf file for files, LDAP, NIS, or NIS+ environments are described in the following table.

naming service Type 

Default printers Entry


printers: user files


printers: user files ldap


printers: user files nis

For example, if your naming service is NIS, printer configuration information on print clients is searched for in the following sources in this order:

For more information, see the nsswitch.conf(4) man page and System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP).

Adding Printer Information to a Naming Service

Adding printer information to a naming service makes access to printers available to all systems on the network. Doing so makes printer administration easier because all of the information about printers is centralized.

Naming Service Configuration 

Actions to Centralize Printer Information 

Use a naming service 

Adding the printer to the LDAP, NIS, or NIS+ database makes the printer available to all systems on the network. 

Do not use a naming service 

Adding the printer adds the printer information to the printer server's configuration files only. Print clients will not automatically know about the printer. 

You will have to add the printer information to every print client that needs to use the printer. 

LDAP Print Support Guidelines

Keep the following in mind when you manage printer information in the LDAP naming service:

How the Printing Software Locates Printers

The following figure highlights the part of the print process in which the printing software checks a hierarchy of printer configuration resources to determine where to send the print request.

Figure 2–2 How the Print Client Software Locates Printers

that shows the steps the print client software uses to locate
printers. Also shows the various printer sources. See the following description.

  1. A user submits a print request from a print client by using the lp or lpr command. The user can specify a destination printer name or class in any of three styles:

    • Atomic style, which is the lp command and option, followed by the printer name or class, as shown in this example:

      % lp -d neptune filename
    • POSIX style, which is the print command and option, followed by server:printer, as shown in this example:

      % lpr -P galaxy:neptune filename
    • Context-based style, as shown in this example:

      % lpr -d thisdept/service/printer/printer-name filename
  2. The print command locates a printer and printer configuration information as follows:

    • The print command checks to see if the user specified a destination printer name or printer class in one of the three valid styles.

    • If the user didn't specify a printer name or class in a valid style, the command checks the user's PRINTER or LPDEST environment variable for a default printer name.

    • If neither environment variable for the default printer is defined, the command checks the sources configured for the printers database in the /etc/nsswitch.conf file. The naming service sources might be one of the following:

      • LDAP directory information tree in the domain's ou=printers container

      • NIS printers.conf.byname map

      • NIS+ printers.conf_dir map