Multicasting multiple mdns names

larzz11

What I would like is to use avahi-daemon to multicast more then one name. So that I could connect to it with domainA.local domainB.local.

I could then reroute these addresses to a different web interface of different applications with nginx.

Is it possible to configure the avahi-daemon in such a way that it would multicast multiple names?

P.S. Using the avahi-daemon is not a requirement. If there is another program that has this functionality I would gladly switch.

Research and results

So as suggested by gollum, I tried avahi-aliases first. It is in the repositories, but it did not appear to have installed correctly on my system. According to the instructions is should have installed a script in /etc/init.d/, but there was none.

I then gave the other link that gollum suggested a try and this worked straight away. It does depend on python-avahi and is just an example of a python script that needs to run in the background. I am now able to broadcast domainA.local, domainB.local and domainC.local and in combination with nginx that leads to different web interfaces on the machine, but are all accessible on port 80.

Update

After some more fiddling with the two, I also discovered that avahi-aliases can only broadcast subdomains. So if your computername would be elvispc then avahi-aliases can only broadcast subdomainA.elvispc.local and subdomainB.elvispc.local, where the python script will broadcast any name.

gollum

A cumbersome solution would be running several instances of the following command in background:

avahi-publish -a -R whatever.local 192.168.123.1

A better solution is probably publishing cnames using python-avahi. See e.g. https://github.com/airtonix/avahi-aliases or http://www.avahi.org/wiki/Examples/PythonPublishAlias

Update:
The avahi wiki seems to be gone. Here is the archived page of the link I've posted: https://web.archive.org/web/20151016190620/http://www.avahi.org:80/wiki/Examples/PythonPublishAlias

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related