It's important not to confuse the 'hosts' file with the role of a DNS server in this instance.
On a local network, your hosts file (/etc/hosts on linux, %SYSTEM_ROOT%\system32\drivers\etc\hosts on windows) is responsible for mapping between names and IP addresses (see wiki page: https://en.wikipedia.org/wiki/Hosts_%28file%29
A DNS server is for resolving a hierarchy of domains from Top Level Domains (such as .com), down to the 'website name' (e.g. amazon.com) and subdomains (e.g. maps.google.co.uk).
The DNS records across the world are cached and expire according to policies in place at each level within the hierarchy and importantly allow the owning organisation (e.g. google) to manage their infrastructure and IP space without needing everyone else to update their records.
This means that once a single request for google.com fails, a query will be sent to google for an updated record, which when returned will replace the existing entry in the cache and then work for everyone else who traverses that particular cache to get to google.com.
The hosts file is an incredibly simplified version of this, there is no domain hierarchy (by default) and all records for all hosts must be stored in all machines on the network in order to function correctly. If you have a lot of machines on your network, then it might be worth taking a machine which is always on (or if none of them are, getting something like a raspberry pi to save power) and running a VM with a DNS server (e.g. BIND) to manage this 'hosts file lookup' process for you, it really doesn't need to be a full DNS server, but depends on your situation. Some routers will have this functionality also, so you may have all you need, but that isn't very common.
As celegorm says, if you're using windows and your machines are all in the same workgroup then it will probably have mapped the IP/hostname mapping for you (use the 'net' command to view this I think, I'm not a windows user so can't be sure on the precise syntax).
Hope that helps!