Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
cannot get cups to send IP address in printer URIs #3737
In my local network environment I cannot reach the cups server via its configured FQDN (hostname+domainname) but only by a different name or IP directly.
The relevant parts of my cupsd.conf:
After CUPS server restart I still get the following data in its broadcast packets:
This is cups 1.4.4 on openSUSE 11.3 (64bit)
CUPS.org User: jp107
I was an idiot earlier and tried replying to the mail message that the STR generated. Sorry for any noise that caused.
Anywat this is my message:
At least in earlier versions of cups, the cups/ipp adverts contain the name/address that cups determines is correct for the interface that the advert is being sent from and isn't related to ServerName at all.
ie for cups-1.3.7 (I happen to have that source at hand) in scheduler/dirsvc.c is the function send_cups_browse() which contains:
so the name/address used is unrelated to what ServerName is set to - it will be looking up the name of the address that it thinks is associated with the interface...
Depending on your setup you may be able to get what you want by one or more of:
getting cups to only listen on the address that the adverts
changing browseaddress to not include interfaces which arn't the ones
use browserelay to send to a specific address/network
In one of our bits of network we have a cups server on a gateway between a network with the 'real cups servers' and the client machines. There is a firewall so the clients wouldn't see adverts from the real servers, so we added a cups server on the gateway which uses browsepoll to the real servers to obtain a list and browserelay to forward the cups adverts that cups-polld sends to cupsd on to the client networks... It is ugly but it does work...
If this helps you then great, if not I may not have explained myself very clearly; or I may have misunderstood what you are trying to do.
None of this should be assumed to be true without checking with either an expert or the current cups source (or both).
CUPS.org User: wrosenauer
The hostname which is sent is basically fine and exactly the one which one would get asking for the name for the local address of the interface where it's supposed to listen. It's just that no other machine in the network knows that name.
CUPS.org User: jp107
Hmm, I always thought that HostNameLookups only affected lookups from client IP addresses (which is what the manual seems to imply), but in cups-1.3.7 I see in network.c cupsdNetIFUpdate() a test which seems to imply what you expected would work:
but in cups-1.4.5 that test for HostNameLookups has changed to:
where RemotePort starts off as zero but gets set to the last port specified in a (non-local) listen (or port) directive (see conf.c).
You could change the source to do what you want (and probably used to work) but currently there doesn't seem to be a way to configure the old behaviour.
I note that several tests for HostNameLookups have now changed into (HostNameLookups || RemotePort) so this probably affects other things too.
Sorry I missed that ...->hostname might not be the DNS name earlier.
--- scheduler/network.c (revision 9128)