• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Locating printer in different subnet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Locating printer in different subnet


  • Subject: Re: Locating printer in different subnet
  • From: Stephen Hoffman <email@hidden>
  • Date: Tue, 04 Dec 2007 15:34:05 -0500
  • Organization: HoffmanLabs LLC

David Lobo writes:

I am newbie to networking concepts. In our application we have a requirement where in, when user gives the IP address the printer details will be displayed and device URI need to accessed. I have used Bonjour discovery and it works fine, if the printer is in the same sub-net. But it was not possible to access a device on different sub-net. Is there any way to access printers on different sub-net.

Bonjour can be viewed as a self-generating and self-administering version of DNS, meaning that subnets and small sites don't need to wade into "true" DNS capabilities. Small IP networks usually don't want to deal with DNS nor with multiple subnets, but moderate- to large-scale IP networks do.


Typical Bonjour will generally deliberately "hide" between any subnet routers that might be involved; it's not usually intended to be accessible across subnets, as you've found. That's where you tend to get into either IP addresses, or into DNS.

Requiring users to enter a printer by IP addresses isn't the prettiest approach for a UI, but you can certainly do a reverse DNS on the IP address (the straight C standard library call is the gethostbyaddr call from within the IP socket calls; off the top, I don't know the Cocoa path to this information but it's likely in the area of the NSNetService or the NSNetServiceBrowser stuff), or you can go directly after the target printer by its IP address.

A call to gethostbyaddr (or an analogous routine) gets you the IP host name, and off you go.

And you can enter the IP address directly into the host field of a URL URI, depending on what you are up to. Address-based URIs work just fine.

I don't know if it's possible to get a name for a host in another Bonjour subnet, I've not tried that. If it's registered in DNS or if you have an IP address (and no firewall blocks you), you'll have no problem getting to the printer.

The Cocoa mailing list can get you the details of the Cocoa network interfaces, if that's of interest.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Prev by Date: Leopard and NIS
  • Next by Date: Re: Leopard and NIS
  • Previous by thread: Re: Locating printer in different subnet
  • Next by thread: Leopard and NIS
  • Index(es):
    • Date
    • Thread