[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: CUPS - how to match autodetected printers to physical ones



On Sun 10 Apr 2022 at 08:52:09 -0400, The Wanderer wrote:

> On 2022-04-10 at 08:38, Brian wrote:

[...]
 
> > The CUPS web interface is not designed to show the IP address but to 
> > display the URI.
> 
> This, I think, is exactly the detail that's being complained of. If CUPS
> knows the IP address, it should be possible to get CUPS to reveal that
> IP address.
> 
> If on the other hand CUPS *doesn't* know the IP address, but only the
> hostname et cetera (because that's part of the URI, and CUPS only
> knows/stores the URI), then that might be reasonable.

CUPS uses the standard networking APIs (getaddrinfo, for example) for
resolving DNS names to get IP addresses, just like every other network
service on Linux. CUPS rolling its own DNS resolver would cause problems
on systems with working resolvers. Why reinvent the wheel?

Basically, CUPS leaves it to libnss-mdns. Why should it have any record
of an IP address when it can easily ask libnss-mdns? We do the same with
avahi-browse.

> (My previous comments were based on the assumption that all
> communication with the printer would be done based on IP address, rather
> than on symbolic name and on connect-time resolution. That may in turn
> be based on my experience in the Windows world, where printer hostnames
> and DNS lookup are in my experience wildly unreliable and as a
> consequence are very rarely used; I reflexively expect that the parts of
> a system which communicate with a printer will always know it primarily,
> if not exclusively, by its IP address.)

Of corse the IP address is needed, but not by the user. The user is
better served by having the queue name matching the printer.

-- 
Brian.


Reply to: