What you’re looking for isn’t domains.
.local is
mDNS, mDNS handles distributed name resolution to IP addresses via multicast.
mDNS usually comes with DNS-SD, which is a protocol that allows publishing services. 2 nice things there: you can publish as many services as you want on a single machine, and you can advertise the port the service uses.
On Raspbian these services are provided by Avahi-daemon, which is preinstalled.
Examples of service declarations with avahi:
https://holyarmy.org/2008/01/advertisin ... hibonjour/
And now the bad news. Web browsers used to feature a “Bonjour Tab” that would listen on the local network and collect all _http._tcp services and provide links you could click. Very useful and friendly.
Some time (like years) ago this was deemed a security threat to web browsers and today none offer a Bonjour Tab. You’ll need to install a browser plugin on each machine, assuming you can find one.
With normal DNS you can give 2 (or a 100) IP addresses to one machine, a name associated to each address. However that does not handle the port part if you absolutely need to use 8080 instead of the standard 80.
You’d need to handle that in a firewall rule..
A better option might be to have an http server listening on one address, many DNS names associated with that address, and redirect rules in the http server, so that the query hits some path or some other based on the hostname part of the url. Could handle port mapping if you need that. Will only work if the protocol is http.