0
votes

I have a Bonjour _http._tcp. service published on iPhone. With the iPhone Wifi Off; running the following dns-sd command on MacBook's terminal:

dns-sd -B _services._dns-sd._udp

then connect the iPhone to MacBook with USB Lighting cable, dns-sd would discover the following iPhone service:

Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
19:22:45.126  Add        3   5 .                    _tcp.local.          _http

disconnect the USB Lighting cable from the MacBook would show:

Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
19:22:45.126  Add        3   5 .                    _tcp.local.          _http
19:23:53.924  Rmv        1   5 .                    _tcp.local.          _http

However, repeating the above steps (running dns-sd, connect and disconnect USB Lighting to PC) on Windows 10 PC, dns-sd did not discover the service.

With the iPhone Wifi On, dns-sd on PC would discover the iPhone service:

Timestamp     A/R Flags if Domain                    Service Type              Instance Name
19:32:36.238  Add     2 13 .                         _tcp.local.               _http

when the iPhone Wifi Off, dns-sd on PC would show:

Timestamp     A/R Flags if Domain                    Service Type              Instance Name
19:32:36.238  Add     2 13 .                         _tcp.local.               _http
19:33:38.471  Rmv     0 13 .                         _tcp.local.               _http

I had Bonjour SDK v333.10 installed from https://developer.apple.com/download/more/?=Bonjour%20SDK%20for%20Windows; and iTunes is working fine (can show the iPhone) on the PC too.

Why dns-sd (Bonjour/ZeroConf) on PC did not discover the iPhone service via USB?

Many thanks.

1
I guess Windows doesn't create an IP network to a USB connected iPhone the way that macOS does. There may be some driver or configuration required on Windows. Perhaps installing iTunes for Windows?Paulw11
Many thanks @Paulw11, iTunes is running fine on the PC with USB connection. I like your suggestion "Windows doesn't create an IP network to a USB connected iPhone". Something to think about.cambs
Since Bonjour Print Services works on Windows USB, to discover iPhone Bonjour services via Windows USB sounds not too far away?cambs

1 Answers

0
votes

Bounjour communication is Socket base. When the iPhone is connected to the MacBook via USB cable, MacBook assigns a private IP address (169.254.x.x) to the iPhone.

Using Discovery - DNS-SD Browser on MacBook, when the iPhone's wifi is Off, Discovery shows the discovered Bonjour service via USB, with the private IP address: enter image description here

When the iPhone's wifi is On, Discovery will show the discovered Bonjour service with two IP addresses (one wifi's, and one USB's): enter image description here

Therefore, dns-sd on MacBook was able to discover the service on iPhone without wifi.