Printing problem in Fedora 32

What is in /etc/hosts?
I have   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6	myhost	myprinter

The message you are seeing says that /etc/hosts does not contain a listed IP for your local host and/or your printer. It does not have to be on a dns server, but having it entered in /etc/hosts will work the same since that file is checked first.
Whichever host you are printing from (local or vm), the appropriate /etc/host file should contain an entry for the IP on the local LAN, and not just the localhost entry at
If desired you can add as many hosts as desired with their IPs, but most apps using the network do require the local host entry for proper communication.
Note that local host as I have used it is your machine with its valid LAN IP, localhost is your machine with the IP and it only talks to itself there.

1 Like

The contents of my /etc/hosts is as follows; localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

Please excuse my ignorance but I’m not sure how to edit it for my situations. I don’t really have a domain defined. Does the “myprinter” in your example need to match the printer name on the computer printer list? I guess it’s curious to me that I’m able to print to the printer without any of these definitions but I need them to scan. Of course, I’ll do what ever is necessary. Thanks in advance.


Check the output:

hostnamectl --static 
hostnamectl --transient
ip address show

In addition to what @vgaetera said, you can set a hostname using hostnamectl. to see what it can do and how simply use the man page with the command “man hostnamectl”

To edit the /etc/hosts file you can use almost any text editor you are comfortable with by also using sudo. For example I would use “sudo vi /etc/hosts” where vi is my favorite text editor but you can use almost any text editor such as nano, gedit, etc. If you edit /etc/hosts it requires a specific format that can be seen by also looking at its man page with “man hosts”

No, you do not have to have the printer defined in /etc/hosts, although it simplifies things for me. If you do it has no affect directly on scanning.

Your problem is that xsane is looking for the interface to use for communication with the network. Since you do not have a hostname assigned nor an IP specified for that hostname then the scanner software is limited to what is listed in /etc/hosts and the IP there is only the loopback address which cannot communicate anywhere except with the localhost. Localhost is the default hostname when not explicitly given and seen with
“hostnamectl --static” or “hostnamectl --transient”

1 Like

Hi folks,

(Sorry for the delay but I had a major reconfiguration of my computing assets. Generally speaking, it’s difficult to get back during the week - it’ll usually take me to the weekend except for occasionally).

The response to both to both hostnamectl commands suggested by vgaetera (–static and --transient) was


The response to “ip address show” was a bit more interesting:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 40:61:86:5d:8e:50 brd ff:ff:ff:ff:ff:ff
inet brd scope global dynamic noprefixroute enp2s0
valid_lft 84384sec preferred_lft 84384sec
inet6 2605:e000:1004:4f6b:6b8c:d88:9449:66b8/64 scope global dynamic noprefixroute
valid_lft 321421sec preferred_lft 321421sec
inet6 fe80::35e3:1d34:b6ef:5e03/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:af:e8:dc brd ff:ff:ff:ff:ff:ff
inet brd scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:af:e8:dc brd ff:ff:ff:ff:ff:ff

Did the Lexmark printer driver have some effect here in the setting up of a multicast interface it’s calling virbr0 and virbr0-nic: or did that come from elsewhere? Should I set about changing this address to the actual printer or is this address different on purpose because it’s the scanner interface? These may be rhetorical questions but I think this is part of question of getting at least one of the two scanners (on the printers) working.

Anyway, I see from the general man pages of hostnamectl the flexibility of setting the host name. I just don’t know what to set it to or how to get it to help get the scanners working. Since my objective is to get the/a scanner working, setting a host name is a bit of a side show. If there’s a strategy to setting it to something that makes future set up or configuration easier, I’m all for it. If setting it to something specific makes getting the scanner working easier, I’m all for it and I’ll do that. Otherwise, it’s kind of a secondary thing at the moment. I’ve been using the Gnome scanner app in this effort because I didn’t want to add another variable (xsane) into the problem. Not knowing whether the problem is xsane or the gnome scanner app is the problem would just make the problem harder. I have reasonable security that the gnome scanner app is installed properly.


you are misunderstanding what you see. The interfaces virbr0 and virbr0-nic are the default virtual interfaces created for use with virtual machines and have no bearing on communications from the host machine to the world. The enp2s0 interface is your actual interface that talks to the LAN and the internet, and from the data there it seems ok at first look.

As far as the hostnamectl command and its results you should set an actual hostname for your host to handle the error you posted here.

Since I (like you) do not use a machine with an internet visible address I just used a made up domain to add the hostname with the command

 sudo hostnamectl set-hostname yourhost.your.domain 

using whatever you feel appropriate for the hostname and domain as long as the domain name you use is not an actual internet reachable domain.

Then in /etc/hosts I would add the line        yourhost   yourhost.your.domain 

Those 2 steps should fix the error you posted. Please try that and let us know if it worked or if there is more we need to help figure out.

1 Like

Hello all,

Back again.

OK, I did this via the command:

 sudo hostnamectl set=hostname

where my specific “” is not a legitimate internet domain.

I, then, added 

to my /etc/hosts file. I first tried without rebooting and behavior was similar although the scan application didn’t ask for which interface I wanted to use. In detail, the Gnome scanner app comes up and asks which scanner interface I want to use (see earlier in thread). Based on previous experience, only one selection has a chance of working, i.e. the Lexmark X543 is the only viable selection of three possible. When activating a scan, the Lexmark interface pops up its message to activate the scan at the scanner. Triggering at the scanner causes the feeder to initiate feeding and the scanner display says “Scanning”. However, soon after, a status page still prints out a status page that says “Connection Error” while a red status light flashes on the scanner/printer.

I only have to write this once because the behavior doesn’t change even after a reboot when the hosts file should have been picked up by everything that needs it. This is true whether or not I reissue the “hostnamectl” command. I’m not sure what else to try, but I’m willing to try whatever else is suggested and, as always, thanks in advance for the help.