To add to the great suggestions already here, XIP.IO is a fantastic wildcard DNS server that's publicly available.
myproject.127.0.0.1.xip.io -- resolves to --> 127.0.0.1
other.project.127.0.0.1.xip.io -- resolves to --> 127.0.0.1
other.machine.10.0.0.1.xip.io -- resolves to --> 10.0.0.1
(The ability to specify non-loopback addresses is fantastic for testing sites on iOS devices where you cannot access a hosts file.)
If you combine this with some of the Apache configuration mentioned in other answers, you can potentially add VirtualHosts with zero setup.