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

Re: Sharing Linux printer with Mac



On Sun, Jan 22, 2006 at 02:49:17AM -0500, Chinook wrote:
> The issue is something that I wondered about (and commented on) early 
> on.  On my Mac I see the printer EpsonSPR300@debian1 but my Mac can't 
> actually print to it because my Mac (via my router) can't resolve the 
> hostname "debian1." 
> 
> When I first put up Debian on the P4, I noticed that where my Mac sets a 
> hostname with its local address on my Belkin router, the Linux box 
> leaves the hostname blank on my Belkin router.  My router does have the 
> Linux box represented as an address (192.168.2.48), but no hostname.
> 
> When the printer was attached to my Mac I could print to it from my 
> Linux box it because the Mac hostname (pmacg5) could be resolved by the 
> router, but now that the printer is attached to my Linux box (and 
> working there) I can't print to it from my Mac because it can't resolve 
> the Linux box hostname (debian1)  :-((((   I had a strong feeling this 
> hostname issue would come back to bite me %-\
> 
> So, whats to do?  Preferably I'd really appreciate some help in getting 
> Debian to post its hostname on the router like my Mac does.  If that 
> can't be done at the moment, then I would appreciate some help in 
> getting my Mac to resolve the Linux box hostname to an address 
> (192.168.2.48). 

If name resolution is the problem, then you might try manually adding
the address of the debian box to the Mac's local name lookup (which is
typically setup to be tried before DNS).  On Unix that would generally
be in /etc/hosts.
I haven't got the foggiest how to admin Macs, but the first hit when
googling for "/etc/hosts equivalent mac" turned up the following
instructions (http://forums.macnn.com/archive/index.php/t-121363.html):

  Just edit /etc/hosts using an admin user.
  This problably won't help though as your name resolution is done through netinfo.
  You need to add the hosts file to you netinfo db.
  If your hosts file is in the format
  xxx.xxx.xxx.xxx some_machine_name
  Then you can login as root (not admin but root)
  $ niload hosts / < your_hosts_file
  You have now added you hosts file to the netinfo db.
  you can use things like nicl to look around it.
  You can take a backup by copying /var/db/netinfo/*.nidb to another dir.

Sounds like a good place to start :)

If that doesn't work for some reason (or if your debian box' local
address isn't static, so you'd have to fiddle with this every time
anew), you could try to figure out how to have debian register its
hostname with the router.  Not sure about the belkin, but most routers
have some web interface and/or provide telnet access to configure such
things. If so, it shouldn't be too hard to automate those steps in some
script, that you could then run during init, or something like that...

Alternatively (and preferably), try to figure out how the Mac is going
about registering its name with the router (maybe there's some other
protocol beyond web or telnet), and then do it the same way on the
debian side.  I'd start digging through the Mac's init scripts... but I
apologize in advance, in case that should put you on the wrong track
entirely ;)  If you're lucky, it's even documented in the router's
manual, or somewhere on the belkin website.

Good luck,
Almut



Reply to: