Reconfirming the DNS the Record

On the 4th question of: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/NetServices/Articles/faq.html

I see:

"you can ask the Bonjour to reconfirm the record"

I am basing my code on the TicTacToe example at:

https://developer.apple.com/videos/play/wwdc2022/110339/

I believe the DNS records which remains after the device that put them there shuts down is causing problems for me when again. Using the DeviceDiscoveryUI as in that TicTacToe example how are these records "reconfirmed" ?

There is no high-level interface to the Bonjour reconfirm record functionality. In general our high-level APIs should take care of this for you. If you’re using a low-level API, you can call DNSServiceReconfirmRecord. I’ve posted a snippet here.

IMPORTANT Do not reconfirm every service you find. The reconfirm record functionality is meant to be used when your connection attempt fails. The assumption is that, if the connection failed then it’s worth the network traffic to see if the service if the service is gone.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is there no way then to tell the high level functions to reconfirm, or cause Bonjour to handle this for me in any way when it has failed to and I need it to?

Are the functions used in the TicTacToe example high level?

Suppose a host that has advertised its service goes offline. If it comes back online before its DNS record's TTL expires should that record remain a valid one that can be used to connect with?

In systems where IP addresses are dynamically allocated will the DNS record remain valid if the IP address for the DNS record's host device has changed?

Does a host that has advertised a service have a means of erasing its DNS record in the WiFi router?

When the host advertises can it set the TTL time?

Are the functions used in the TicTacToe example high level?

Yes.

Suppose a host that has advertised its service goes offline. If it comes back online before its DNS record's TTL expires should that record remain a valid one that can be used to connect with?

Yes. In Bonjour you browse for a service type and get back a set of service name / type / domain tuples. As long as the now-back-online host uses the same tuple for its service, the connection will work.

In systems where IP addresses are dynamically allocated will the DNS record remain valid if the IP address for the DNS record's host device has changed?

Yes. You’ll note that the IP address isn’t in the above tuple. When you go to connect you resolve that tuple to a DNS name and IP addresses, which only have to be valid at the time you connect.

Does a host that has advertised a service have a means of erasing its DNS record in the Wi-Fi router?

This question doesn’t make sense. Bonjour service discovery is entirely independent of network infrastructure [1].

When the host advertises can it set the TTL time?

No.

Keep in mind that Bonjour is a marketing name for three Internet standards:

  • RFC 3927 Dynamic Configuration of IPv4 Link-Local Addresses

  • RFC 6762 Multicast DNS

  • RFC 6763 DNS-Based Service Discovery

The key one here is RFC 6762, which explains how Bonjour extends DNS to work without any network infrastructure, using multicasts to maintain a distributed database of DNS records. If you want to know how this really works, that’s the place to go.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Well… that’s not 100% true. If the Wi-Fi router offers a sleep proxy service then that might be a relevant question, but I doubt that’s the case here.

Reconfirming the DNS the Record
 
 
Q