sudo ./install-systemd.sh
#add aliases to /etc/avahi/aliases
sudo avahi-publish-aliases
sudo ./uninstall-systemd.sh
Included is an installer for a systemd service. Tested this on Ubuntu 18.x.
sudo ./install-systemd
Requires python-dbus, python-avahi
sudo service avahi-alias start
sudo service avahi-alias restart
sudo service avahi-alias stop
sudo nano /etc/avahi/aliases.d/default
- insert something.local on a new line
- save
- ???
- profit
* aliases must end in `.local`
* One alias per line
* blank lines are ignored
* lines prefixed with `#` are ignored
* you must manually restart the daemon after modifying alias files
- Original sources from avahi: http://www.avahi.org/wiki/Examples/PythonPublishAlias
- Discussion on stackoverflow: http://stackoverflow.com/questions/775233/how-to-route-all-subdomains-to-a-single-host-using-mdns?answertab=votes#tab-top
- Original github repo: https://github.com/airtonix/avahi-aliases
- Original systemd repo : https://github.com/5sw/avahi-aliases.git
- Service implementation : https://gist.github.com/gnue/ba0e9e6e52eac2d324d73dacefb0b6cf