Previous Section  < Day Day Up >  Next Section

Recipe 14.4. Sharing a Printer Without Using Name Resolution

14.4.1 Problem

You haven't bothered to create /hosts files, or set up a local DNS server on your LAN, because you have no need for name resolution. The PCs on your LAN sit comfortably behind a NAT firewall, for sharing an Internet connection, and that's all they need. So how do you share a printer?

14.4.2 Solution

Give your printer server a static IP address. Add a ServerName directive to /etc/cupsd.conf on the server, using its own IP address:

ServerName 192.168.1.5

Restart cupsd. On Debian, use:

# /etc/init.d/cupsys restart

On Red Hat and Fedora, use:

# /sbin/service cups restart

There is nothing to do on the client PCs, except wait a few seconds for CUPS to broadcast the printer. If you get the infamous "client-error-not-found" message, stop and restart the printer.

14.4.3 Discussion

By default, CUPS uses the hostname as the ServerName. If you are not using any kind of name resolution, your client PCs will not see any CUPS printers. Specifying the IP address as the ServerName fixes that. A side effect is that you may not be able to print a test page from the server; instead, you'll get the screen shown in Figure 14-2.

Figure 14-2. No CUPS page


However, you'll still be able to print from applications on the server. Client PCs won't notice anything odd.

If you don't need to set up a network filesystem such as NFS or Samba, or use DNS; it's perfectly okay, even if the other geeks laugh at you. A primary rule of security is "don't run what you don't need."

14.4.4 See Also

  • CUPS Software Administrators Manual (http://localhost:631/documentation.html)

    Previous Section  < Day Day Up >  Next Section