The last two I've used over the last decade have automatically done this. Every machine requesting a DHCP lease is assigned "$host.lan" in the DNS service on the router, where "lan" is a default but configurable domain name.
But even if you don't have this, then zeroconf/avahi/equivalent should be giving you "$host.local".
But even if you don't have this, then zeroconf/avahi/equivalent should be giving you "$host.local".