hostname instead of ip address

Olin Shivers shivers at ccs.neu.edu
Sun Jul 31 15:03:10 PDT 2011


I'd like to print to my home printer from my office computer. I'm having
trouble making it happen and hoped I could get some advice here.

The cupsd.conf on my home computer -- let's call it "homecomp" -- says

    ServerName homecomp.dyndns.org
    Port 631

This computer is on a home LAN that sits behind a cable-modem/NAT-router. If
you do a DNS lookup on homecomp.dyndns.org, you'll get the IP address of the
cable modem. The NAT router forwards any incoming external connection to port
631 to the home computer's local IP address, which is (and this will be
relevant in a minute) 192.168.1.20.

My printer at home is a network printer. It sits on my home net at IP address
    192.168.1.40
which is advertised via mDNS on my LAN as the address for
    homeprint.local

I've also defined it as a local printer, "home-printer", on my home computer's
CUPS server, with URI
    socket://homeprint.local:9100
That is, homecomp's CUPS server has en entry in printers.conf with this URI.

So, at home, I can print *directly* to the printer with URI
    socket://homeprint.local:9100
and from *anywhere* -- home or outside home -- I can print to to the printer
via CUPS with URI
    ipp://homecomp.dyndns.org:631/printers/home-printer

At work, my computer's cupsd.conf has

    BrowsePoll homecomp.dyndns.org

Now, when I connect to my work computer's cups server, I can see
    home-printer
as one of the options; it is also offered as one of the choices from
various print panels.

The problem is that I check the definition of home-printer, at work, I see
that it's defined to be at URI

    https//192.168.5.20:631/printers/home-printer

Note the host -- it's not homecomp.dyndns.org. It's not a hostname at all --
it's the *local IP address* of my home computer, which only makes sense on my
home net. It doesn't make sense at work.

Now, I could *locally* define a network printer on my work computer --
that is, have an entry at work in printers.conf defining a printer to be the
URI

    http:/homecomp.dyndns.org:631/printers/home-printer

But this seems like the wrong answer. I want to set up my cups server
on my home computer so that anyone doing a BrowsePoll on it will get
the right URI for its printer.

Any advice?
    -Olin




More information about the cups mailing list