Not able to set alias name for localhost in CUPS client

Solution Verified - Updated -

Issue

I would like to add an "alias" name for localhost in /etc/hosts on a system running a CUPS client and then use that alias name as a hostname to which to print. For example, I add the name cups01 to the list of names that resolve to 127.0.0.1:

# cat /etc/hosts
127.0.0.1   cups01 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

and then I try to print to cups01, but the following error is returned:

# lpr -H cups01 -P pr4310 test.txt
lpr: Error - add '/version=1.1' to server name.

The printer pr4310 is properly defined because this command works as expected:

# lpr -H localhost -P pr4310 test.txt

Environment

  • Red Hat Enterprise Linux (RHEL) 7
  • Common Unix Printing System (CUPS) 1.6.3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content