Bonjour, also known as zero-configuration networking, enables automatic discovery of devices and services on a local network using industry standard.

Pinned Posts

Posts under Bonjour tag

47 Posts
Sort by:
Post not yet marked as solved
0 Replies
102 Views
I am trying to download XCode apps from my Mac to my Apple Vision Pro for testing. I have tried following the instructions by going into Settings->General->Remote Devices on my Apple Vision Pro, but there my Mac does not show up as a possible connection. Per this page, I have made sure that both devices are connected to the same WiFi network, updated my Mac to Sonoma, and updated my AVP to the latest OS, and everything else that it asks for. I am able to mirror my display from my Mac but downloading apps from XCode does not work. I have also looked to enable Developer Mode by going to Settings -> Privacy & Security -> Enable Developer Mode, but there is no option for enabling developer mode here. Per this forum, my best guess is that it is a Bonjour Protocol compatibility issue since both devices are on university wifi (WPA2), but I also tried connecting both over a hotspot which also did not work.
Posted Last updated
.
Post not yet marked as solved
1 Replies
148 Views
Since the Multipeer Connectivity framework no longer supports Bluetooth. (https://developer.apple.com/forums/thread/749346) Why does its official documentation still mention "In iOS, the framework uses infrastructure Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks for the underlying transport." ?(https://developer.apple.com/documentation/multipeerconnectivity) What is the purpose of using Bluetooth personal area networks for the underlying transport?
Posted Last updated
.
Post not yet marked as solved
1 Replies
191 Views
Hello, In this inquiry(https://developer.apple.com/forums/thread/747860), I came across this conclusion. “Apple disabled TCP/IP networking over Bluetooth completely. Apple’s peer-to-peer networking APIs now run exclusively over Wi-Fi." I have three questions I would like to ask. The Multipeer Connectivity Framework supports Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks. Since the framework abstracts away the underlying protocols, we cannot specify which protocol to choose. Can this framework still establish a pure Bluetooth connection now? (Not just using Bluetooth for the discovery phase). Given that the framework supports Bluetooth protocols, why does it not require Bluetooth permissions but only local network permissions? Does the Bluetooth protocol supported by the framework have the capability to discover traditional Bluetooth devices and services that the Core Bluetooth framework can discover?
Posted Last updated
.
Post not yet marked as solved
5 Replies
299 Views
I am currently attempting to resolve the hostname of a device connected to the same Wi-Fi network as mine. However, I've been unable to find sufficient resources or documentation on utilising the NBNS (NetBIOS Name Service) protocol for this purpose. Can someone please provide guidance on how to achieve this?
Posted Last updated
.
Post marked as solved
1 Replies
171 Views
I compiled the Bonjour source code myself both for Linux and windows. Then I succeed in publishing and detecting services for two Windows devices. But I can't use Bonjour between a windows device and a Linux device. So is this a limitation? If not, any tips on how to solve it?
Posted
by zoe105.
Last updated
.
Post not yet marked as solved
2 Replies
243 Views
Local network permissions are required to use the Bonjour service, But Bonjour service can also detect nearby devices through Bluetooth scanning without Bluetooth permission. https://developer.apple.com/library/archive/qa/qa1753/_index.html#apple_ref/doc/uid/DTS40011315/ Did I misunderstand? Or is there an issue with Apple's design here?
Posted Last updated
.
Post not yet marked as solved
0 Replies
168 Views
Using the Bonjour service requires obtaining local network permissions, but the Bonjour service also scans nearby devices through Bluetooth. Why doesn't Bluetooth permission be required? https://developer.apple.com/library/archive/qa/qa1753/_index.html#apple_ref/doc/uid/DTS40011315/ Did I misunderstand? Is there an issue with the design of iOS here?
Posted Last updated
.
Post marked as solved
1 Replies
175 Views
unresolved external symbol _mdns_malloc@4 referenced in function _syslog dnssd \mDNSResponder-2200.80.16\mDNSWindows\DLL\dnssd_clientstub.obj unresolved external symbol _mdns_free@4 referenced in function _syslog dnssd \mDNSResponder-2200.80.16\mDNSWindows\DLL\dnssd_clientstub.obj
Posted
by zoe105.
Last updated
.
Post not yet marked as solved
1 Replies
320 Views
Hello! I'm working on VLC, that is a multimedia playback app available for any platform. Among many things, we support discovery of servers on the local network using Bonjour, UPnP and NETBIOS with consecutive connections to those servers for media playback purposes. Additionally, we allow connections to unicast and multicast streams based on any domain name or IP (i.e. "rtsp://207.254.***.***"). Discovery of the mentioned services works very well with the Multicast entitlement along with NSLocalNetworkUsageDescription also on iOS 17. According to documentation, iOS 17 prohibits any IP based connections by default, which breaks the entire functionality mentioned above that was previously enabled by including the NSAllowsArbitraryLoads key with the value TRUE in Info.plist. We amended the Info.plist with the following configuration and still fail to connect to hosts in that IP range. <key>NSAllowsLocalNetworking</key> <true/> <key>NSExceptionDomains</key> <dict> <key>192.168.0.0/24</key> <dict> <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSIncludesSubdomains</key> <true/> <key>NSExceptionRequiresForwardSecrecy</key> <false/> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSExceptionAllowsLocalNetworking</key> <true/> </dict> </dict> Additionally, there does not seem to be a viable, publicly documented solution to connect to any server on the internet based on an IP address. Further, the process for IPv6 seems unclear. Any help how to solve this so we can transition to the iOS/tvOS 17 SDK in time would be very much appreciated.
Posted Last updated
.
Post not yet marked as solved
2 Replies
410 Views
I am facing this error on my SDK project. Could not identify what's the actual issue. I've added the Firebase crash logs below. Crashed: com.apple.root.default-qos 0 libdispatch.dylib 0x1a778 dispatch_channel_cancel + 12 1 libdispatch.dylib 0x1a778 dispatch_source_cancel + 12 2 libsystem_dnssd.dylib 0x2084 DNSServiceProcessResult + 860 3 Common 0x2df04 __swift_memcpy5_4 + 25916 4 Common 0x10b00 block_destroy_helper.10 + 188 5 libdispatch.dylib 0x26a8 _dispatch_call_block_and_release + 32 6 libdispatch.dylib 0x4300 _dispatch_client_callout + 20 7 libdispatch.dylib 0x744c _dispatch_queue_override_invoke + 928 8 libdispatch.dylib 0x15be4 _dispatch_root_queue_drain + 392 9 libdispatch.dylib 0x163ec _dispatch_worker_thread2 + 156 10 libsystem_pthread.dylib 0x1928 _pthread_wqthread + 228 11 libsystem_pthread.dylib 0x1a04 start_wqthread + 8
Posted Last updated
.
Post not yet marked as solved
1 Replies
296 Views
I would like to get the full DNS responses from the system resolver. I'm using DNSServiceQueryRecord, but I can't get negative responses. How do I get the negative responses? I need the full response because they have clues about network-level censorship. For instance, mismatched case in the name, bad answer RR type, missing SOA record on no answers response. On Android I can use android_res_nquery, but I couldn't find anything similar on iOS and macOS. The closest I found was DNSServiceQueryRecord, which at least gives me resource records, so I can inspect TTL and name case. After some struggle, I was able to make it work. I'm using Go with cgo for that: https://github.com/fortuna/gio-test/blob/fortuna-dns/sysresolver_darwin.go https://github.com/fortuna/gio-test/blob/fortuna-dns/sysresolver_darwin_export.go My sequence of calls is: DNSServiceQueryRecord(sdRef, 0, 0, fullname, rrtype, rrclass, (DNSServiceQueryRecordReply)goCallback, context); fd := C.DNSServiceRefSockFD(sdRef) nReady, err := unix.Poll([]unix.PollFd{{Fd: int32(fd), Events: unix.POLLIN | unix.POLLERR | unix.POLLHUP}}, timeout) serviceErr = C.DNSServiceProcessResult(sdRef) // Here my callback gets called, multiple times for multiple answers. C.DNSServiceRefDeallocate(sdRef) I'm able to get positive answers, even multiple answers. But the Poll doesn't return when there are no answers (like for CNAME www.example.com). I expected the poll to return on negative answers, and my callback to be called with an error when calling DNSServiceProcessResult. Is that not the expected behavior? How do I get notified that a query has no answers?
Posted
by fortuna.
Last updated
.
Post not yet marked as solved
2 Replies
480 Views
Hi, I have a strange problem. In my local network, I have some apple devices (including mac, iphone, ipad) and a windows computer. The windows pc and any of the apple devices can ping each other, while every two of the apple devices can't ping each other. Whether udp or tcp are in the same situation. As is the situation, the firewall/mask/local ip are not the problems. I can't use wireshark to debug, because there is not any packet between these apple devices. Does someone know what the problem it may be? Or could someone tell me how to debug this? Thanks in advance!
Posted
by fduan.
Last updated
.
Post not yet marked as solved
1 Replies
506 Views
After upgrading to iOS 17 (now 17.2.1) on iPhone 11 pro the device does not appear to be discoverable on the local network via Bonjour. This is impeding, e.g., connecting to the device with iMazing etc. I looked at the local network with the Discovery app for Bonjour and while an iPad running iOS 16 is visible, the iPhone with iOS 17 is not. Any ideas ? We need to connect with iMazing via wifi since the mighty lightning port is predictably hosed for USB connection. Any insight appreciated. Thanks!
Posted
by upcountry.
Last updated
.
Post not yet marked as solved
1 Replies
432 Views
It worked fine before iOS 17.1. Just checked with iOS 16 on real device. And my teammate from QA department confirmed it works for iOS 17.0.1. The problem occurs only with device in local network connected via ethernet. The device itself has two options for connection - via Wi-Fi and Ethernet. It works for all iOS versions via Wi-Fi. But it can't resolve host for Ethernet connection. Error appears in func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) looks like that: (NSNetServicesErrorDomain: 10, NSNetServicesErrorCode: -72007) Could you please explain this error code?
Posted Last updated
.
Post marked as solved
2 Replies
342 Views
I expect there is a shockingly obvious answer to this, but I've been stuck a couple of days on Problem Obvious and could use a tip / cake-with-file to escape from development jail. I have used DNSServiceRef / Bonjour to advertise my service, and have used the same to get a list of what is advertised (using the hit on lo0 for the moment since still testing). So, now I have a machine name "mymachine.local." and the right port number to connect to. Yay! What I can not figure out is how to get that information into a (IPV6) sockaddr so I can use it with connect. The point of confusion for me is that DNSServiceGetAddrInfo() does not take a port argument, and I see no other place to squeeze this information into the sockaddr returned by the DNSServiceGetAddrInfoReply. If I just use a IPV6 socket with that sockaddr, I get back EADDRNOTAVAIL. Haven't tried IPv4. No error is returned from DNSServiceGetAddrInfo. I'm reading around that this may be because the port is 0, and indeed I can't find any spot in this pathway to squeeze that information in. I'll attach an obligatory bit of code so that the reader may feel more grounded: // My DNSServiceGetAddrInfoReply void ServiceList::Node::AddressInfoCallback( DNSServiceRef __nonnull _sdRef, DNSServiceFlags _flags, uint32_t _interfaceIndex, DNSServiceErrorType _errorCode, const char * __nullable _hostname, const struct sockaddr * __nullable _address, uint32_t UNUSED _ttl, void * __nonnull context) { printf( "AddressInfo: \"%s\"\n", _hostname); AddrInfo * info = (AddrInfo*) context; if( kDNSServiceErr_NoError != _errorCode || NULL == _hostname || NULL == _address) { LOG_ERROR("Failed to get address info on \"%s\"\n", (const char*) info->hostTarget); delete info; return; } int err = connect(info->socket, _address, _address->sa_len); // returns EADDRNOTAVAIL on IPv6 socket. What am I really trying to do? I'd like to connect to the address and port that I from my DNSServiceResolveReply.
Posted Last updated
.
Post not yet marked as solved
1 Replies
439 Views
Hey All, I'm currently trying to use the BCT v1.5.3 to validate the avahi mdns implementation. This is not so much to validate the avahi implementation but to actually understand how the BCT works. My setup is the following: the testing machine, where the BCT runs, is a 13-inch MacBook Pro 2019 the DUT (Device Under test) where avahi runs is a Linux machine (arch) and avahi runs version 0.8 I've tried several connection between the two: they have been connected point-to-point by a single network cable and the IPs have been set statically they have been connected via a router (that's not connected to the interned) both by cable and with IPs statically set connected via a router where the BCT computer is connected via cable and the DUT is connected via WIFI. My requirement is to run only the MDNS tests so the command I'm issuing on the BCT side is: sudo ./BounjourConformanceTest -M -I en4 -DD -V -Aip None -Amac None On the DUT side I start avahi as a daemon: sudo avahi-daemon And after that I also publish a service. I've done several tries but one that I think should be working is: sudo avahi-publish -s "My HAP Service" _hap._tcp 3213 [] I can see the three packets that make up the probing packets spaced out at 250ms each on wireshark both on the DUT and on the BCT device and the BCT prints: recv_packet 01997: received packet (96 bytes) recv_packet 01997: received packet (96 bytes) recv_packet 01997: received packet (96 bytes) But the tests doesn't seem to finish correctly. What am I doing wrong? Is my configuration incorrect/incomplete? Do I need to advertise a certain service? Thanks for the response in advance.
Posted
by radu_alx.
Last updated
.
Post not yet marked as solved
1 Replies
396 Views
We use the OSS release of mDNSresponder fairly extensively and have patched it to fix some issues. I was curious if Apple accepted such contributions upstream, or provided a way to communicate the changes for potential inclusion in future patches, as maintaining a fork isn't ideal for both parties. It seems that PRs on the GH repo are not always reviewed, but there is some evidence that they are looked at. We realise that POSIX implementation for mDNSResponder might not be a priority for Apple, but curious if there's a process for contributions from industry?
Posted Last updated
.
Post not yet marked as solved
4 Replies
1.1k Views
Hello there, We have an iPad application which uses mDNS to find specific devices on the network then it resolves an IP address so then the application can connect to it through websocket. It has been working for years now. Recently our clients started to update their iPads to iOS 17 and suddenly this functionality stopped working. When I wanted to test out what's going on I found out that when I run the application on an iPad simulator on my macbook it can resolve the IP address immediately but when I run it on an iPad it cannot. That seemed weird so I decided to look into the code and I saw that the NetServiceBrowser api had been deprecated and I thought that maybe that's the problem so I refactored the code to use NWBrowser which was rather easy it found the service, but then when I wanted to meg an NWConnection to it the same error happened. From macOS it works fine but on the iPad the connection's state never gets ready, it hangs on the preparing state. I created a new test application just with this functionality to test it on an iPhone too. Well it seems that the issue is appearing on the iOS too. One other thing to mention, I created a simple node.js application which uses mDNS broadcast to simulate this device which we're trying to connect. The weird part that both the iPad and the iPhone can resolve it's address. I'm curious if something has changed since iOS 16, I couldn't find anything and I don't know where to go next, or how can somebody reproduce this error without the device. Any help is appreciated. Here is my discovery code: import UIKit import Network class ViewController: UIViewController { var browser: NWBrowser! override func viewDidLoad() { super.viewDidLoad() browser = NWBrowser(for: .bonjour(type: "_http._tcp", domain: ""), using: .tcp) browser.stateUpdateHandler = { newState in switch newState { case .failed(let error): print("NW Browser: now in Error state: \(error)") self.browser.cancel() case .ready: print("NW Browser: new bonjour discovery - ready") case .setup: print("NW Browser: ooh, apparently in SETUP state") default: break } } browser.browseResultsChangedHandler = { ( results, changes ) in print("NW Browser: Scan results found:") for result in results { switch result.endpoint { case let .service(name: name, type: _, domain: _, interface: _): // All of our device has 'justfit' in their name if name.uppercased().contains("JUSTFIT"){ print(name) let proto: NWParameters = .tcp if let opt = proto.defaultProtocolStack.internetProtocol as? NWProtocolIP.Options { opt.version = .v4 } let connection = NWConnection(to: result.endpoint, using: proto) connection.stateUpdateHandler = { state in if state == .ready { if let path = connection.currentPath, let endpoint = path.remoteEndpoint { switch(endpoint) { case let .hostPort(host: host, port: port): print("IP: \(host), port: \(port)") break default: break } connection.cancel() } } else { print(state) } } connection.start(queue: .main) } default: break } } } browser.start(queue: .main) } }
Posted
by lcsoka.
Last updated
.
Post not yet marked as solved
1 Replies
395 Views
I'm running a webserver for a specific service on port 8900 I'm using telegraph to run the webserver, so that opens and claims the port. I also want to advertise the service on bonjour - ideally with the correct port. This is trivial with NetService - but that's deprecated, so I should probably move to the Network framework. I can advertise without specifying a port listener = try NWListener(service: service, using: .tcp) but, then my service broadcasts addresses with port:61443 I can advertise using listener = try NWListener(using: .tcp, on: <myport>) however, that fails in my use case because (unsurprisingly) the Listener isn't able to get the port (my server already has it) Is this just a gap in the new API, or am I missing something?
Posted Last updated
.
Post not yet marked as solved
1 Replies
604 Views
I'm currently trying to use an ESP8266, connecting to my home WiFi and starting a mDNS service. Then im trying to discover this service using the bonsoir package in flutter. So far so good. On Android everything works fine, but i want to use the app on the iPhone too. As far as i understood the information in this video 'developer.apple.com' i need to add this to my info.plist: <key>NSLocalNetworkUsageDescription</key> <string>Some understandable text for the user.</string> <key>NSBonjourServices</key> <array> <string>_http._tcp.</string> </array> I wrote a short python script which resolves the service in my network and im getting the following output: Service ESP8266Control._http._tcp.local. added, service info: ServiceInfo(type='_http._tcp.local.', name='ESP8266Control._http._tcp.local.', addresses=[b'\xc0\xa8\x02\xa0'], port=80, weight=0, priority=0, server='ESP8266Control.local.', properties={b'SN': b'10 - 00001'}, interface_index=None) Address: ['192.168.2.160'] Port: 80 Service Name: ESP8266Control._http._tcp.local. Server: ESP8266Control.local. Properties: {b'SN': b'10 - 00001'} My flutter app should be correct because on android everything works as expected. I tried to discover the service in my network by building my app on a mac book for ios. The popup for using the network appears with the defined message "Some understandable text for the user." and i have to confirm the usage of network discovery usage. But when i hit the button in my app to search for my wordclock, the following error is output: [discovery] [28317] Bonsoir has encountered an error during discovery : ["NSNetServicesErrorCode": -72008, "NSNetServicesErrorDomain": 10] [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(discoveryError, Bonsoir has encountered an error during discovery., {NSNetServicesErrorCode: -72008, NSNetServicesErrorDomain: 10}, null) Is my syntax wrong in my info.plist? I also tried to use this ESP8266Control._http._tcp. and several combinations with .local at the end, with and without the service name and with _http and _tcp seperated as 2 individual entries. I tried A LOT of combinations, but nothing changes anything. This is one of the combinations i've tried: <array> <string>_ESP8266Control._http._tcp</string> </array> <key>NSLocalNetworkUsageDescription</key> <string>Need access to connect with the clock itself.</string> <key>NSLocationAlwaysUsageDescription</key> <string>This app needs access to location when in the background.</string> <key>NSLocationWhenInUseUsageDescription</key> <string>This app needs access to your location to show nearby networks to connect the Wordclock to.</string> I would apprecciate help so much, we wasted so much time on this and the apple support told they can't help us... Best regards MeisterTubi
Posted Last updated
.