Originally Posted by
gfunkdave
Hosts is a Windows hack and artifact from much simpler times, but yes, the function of the hosts file is DNS resolution - albeit just for very limited cases. I believe it came about when networking was new and you needed a way to detail all the hosts on your local network (and they could all fit in a file, and didn't change much).
edit: Wikipedia points out I'm correct. yay! Hosts started in the early 80s and was supplanted by DNS, which automated the functionality and expanded it. It's amazing that the hosts functionality remains after all these years.
https://en.wikipedia.org/wiki/Hosts_(file)
Hosts is also integral still on MacOS and on Linux. It works with DNS - DNS doesn't really replace it. At this point, it's almost like an override file. It's an earlier stop for domain name resolution.