Add an alias for LAN/WLAN IP

Right now Apache server is listening on port 80. I want people on the same network to access the site as random.xyz but without making that my actual hostname (which is ubuntu right now).

The manual for hostname isn't really giving much insight. Is there any way to achieve this?

Adding a name under /etc/hostname only works locally (so I can now type http://minsky and get the site. Something like this would be ideal:

127.0.0.1 localhost.localdomain localhost
127.0.1.1   ubuntu minsky #this sets aliases for the machine, but on the lan we can only use the IP address.
192.168.1.33 minsky

But minsky isn't recognized by other devices. Only ubuntu


The hostname you specify on the server does not have to relate to how other systems would find your system. /etc/hostname is only one of the name resolving mechanisms. Usually a DNS server is used. Some of the DNS servers provide a way to add local entries based on DHCP leases. So when the host asks for an IP address it is added to the DNS server, but this depends on your setup.

mdns/avahi/zeroconf as suggested works without dns server. But I would prefer a dns server which resolves whatever hostname you want to point to your webservers ip address