[GSOC 2024] MDNS / Bonjour / Avahi network discovery

DNS resolution happens in netresolv which I have linked earlier. Currently this code is run in each application that does DNS requests, not in a “server” (this is the ord we use for what would be called daemons or services in other systems, it can be a bit confusing when talking about network).

In the case of mDNS, it is interesting to have a server, mainly for sending the information about the current system, and maybe also for “caching” what was already discovered about the network and neighbouring machines. This will avoid the situation where you open an app that does mDNS requests, and it takes several seconds until things are discovered. But, making it work fast and integrating it in the OS can bediscussed later. First, let’s try to see if we can get mDNSresponder to run and work with few modifications to its architecture, and wecan ite|ate from there?

So you mean integrating mdnsresponder into netresolv?

First, just compile mDNSResponder and get it running. Make sure it can advertise the current machine on the network, and see what tools are provided with it to list and find other machines on the network. Once we have a good idea of the status of that, we can start thinking about a plan for integrating it in one or another compoment of Haiku. At the moment, I have no idea which way would be best because I don’t know how mDNSResponder is architectured.

Not sure if apple did it intentionally, but in GitHub - apple-oss-distributions/mDNSResponder, there is somethong called “[Click here to learn how to set up and use mDNSResponder.][1]” but there is no link associated with it(I have windows computer). Wait, can I install using the link here:Download Bonjour Print Services for Windows v2.0.2 - Apple Support

I think the document was weitten wirh a different markup in mind than github uses.

In any case, this is the linked document: mDNSResponder/Documents/mDNSResponder.md at main · apple-oss-distributions/mDNSResponder · GitHub

edit: the windows link doesn‘t help you much. Modern windows versions already include this functionality in one way or another, installing mdnsresponder is not neccesary anymore.

1 Like

OK. Right now, I really could not write anything about the plan(Probably other people can and they will get selected). And my plan is to write something about mDNSresponder and the rfc that is related to mDNSresponder.(At least to demonstrate I somewhat understand what is going on). And I will keep working on it fter proposal deadline@PulkoMandy

Do you know in the past, has anyone tried to do this project and are they making some progress on it?

No, I don’t think so

You could try avahi from Haikuports and check how things work in your network environment.
I can’t remember how good or bad it worked. Possibly multicast in Haiku wasn’t working good enough.

Do you mean rather than for centralized DNS resolution(all DNS queries from various applications on a system or network are directed to a single DNS resolver service), in Haiku, it uses decentralized DNS resolution(each application may implement its own DNS resolution mechanism.)

Do you mean download from GitHub - apple-oss-distributions/mDNSResponder? But the link for instruction of how to set up and use mDNSResponder in the readme.txt does not work. Then do I need to follow this How to install and configure mDNSResponder | The FreeBSD Forums? But other developer said it should be built into my computer already. I am confused about what I should do here

I think neither is quite right.

The configuration is centralized and managed by the network preferences.

The code implementing DNS resolution is implemented in libnetwork, a shared library used by all applications that use network sockets in Haiku.

But the DNS requests are sent directly by each application to the selected DNS server (obtanied by DHCP or manual configuration in network preferences).

That’s what other operating systems are doing, and what we want to do here with this project. Haiku is a bit different from the other systems, so the instructions probably can’t be used as they are provided (since no one did this before, it makes sense that no one could write instructions for it either).

We can try to help you, if you give us more details about what problems you got by trying the procedure in the README. You just said “it does not work”, which is not enough to know what exactly the problem is.


Sorry,I should make it clear.I mean the link here is not active.(the link for how to set up mDNSresponder)

I‘ve already provided the correct link in a previous message.

Sorry,let me try it myself.

I have downloaded the package from Sign In - Apple and the only instruction I have in this package is


And I tried to compile the C version code in the sample folder(compile dns-sd file, but got some errors after making some changes(picture below)). I am confused here as I can not find the mDNSresponder file.

I work in Haiku, I will not be able to help with problems compiling things for Windows.

2 Likes

This looks like a good starting point, doesn’t it?

Maybe you need to make some adjustments to the makefile to build it under Haiku.

1 Like

I just got the Haiku to work.And I am wondering for mdnsresponder,should I download bonjour sdk for windows or macOS(and then make changes) on Haiku?
And in general if I want to download anything like viscode so I can run the code,which OS should I download
@PulkoMandy

By the way one thing I notice when joining the network on haiku is when I need to join Wi-Fi on college campus,some network required me to have both username and password.However,I do not think username field exist on haiku