Open tomjn opened 3 years ago
This is the puppet config Chassis uses to do it:
https://github.com/humanmade/Chassis/blob/master/puppet/modules/chassis/manifests/hosts.pp
GitHub📦 Chassis is a virtual server for your WordPress site, built using Vagrant. - Chassis/hosts.pp at master · humanmade/Chassis
So installing avahi-daemon
is enough to get it to expose itself, but it will only expose the machines hostname ( or a different one if we configure it ), and can only do .local
TLDs.
If we want multiple TLDs though then we need to take extra steps of wwhcih there are a few options
/etc/avahi/hosts
to list additional domains, but we need to specify the IP too and restart the service when it changes ( it may not be necessary too restart the avahi service ). The file has the same format as the system hosts fileavahi-utils
and use avahi-publish-address
too add a single hostname, which immediatley advertises the new host, but the command will keep running, it's more like a daemon/background process
avahi-publish -a -R taxgod.local 192.168.1.2
( tested locally on a non-VVV system )/usr/bin/avahi-publish -a -R taxgod.local 192.168.1.2 &
Useful links:
Server FaultI want to broadcast multiple host names on a local network only from a single instance of Ubuntu Server 10 with Zeroconf or something similar. It has to be zeroconf or similar because it's going t...
Haven200Avahi is a free zero-configuration networking (zeroconf) implementation, including a system formulticast DNS/DNS-SDservice discovery.
Linux Command Libraryavahi-publish linux command man page: Register an mDNS/DNS-SD service or host name or address mapping using the Avahi daemon
Stack OverflowI have a development webserver hosting as "myhost.local" which is found using Bonjour/mDNS. The server is running avahi-daemon. The webserver also wants to handle any subdomains of itself. Eg "cat.
pi3g.comIn some situations you would like to access the same computer / IP using different .local names. This is possible using the Avahi daemon. The following is written for Ubuntu 18.04 Bionic Beaver. Install Avahi apt install avahi-daemon avahi-utils Avahi automatically adds your computer’s hostname to the .local Domain. For instance, my computer is called…
Also, it seems that this won't work on Windows out of the box:
vvv.local
default host, it also installs avahi-utils
. It doesn't support the other hosts or site hosts thoughfor sites, ideally it should pick up any hosts ending in .local
and serve them via Avahi. We'll also need the xhgui domain in .local
form, and to adjust the dashboard so vvv.local
is used instead of vvv.test
when loaded on that URL
Sites that use a
.local
TLD could be advertised using.local
.This would give a way to provide a hostname that can be used on devices that do not support host file modification. For example, when provisioning on a dedicated device such as a raspberry Pi connected to an iOS device.