JavaScript and Web Development

Stop Always Using Hosts Files for Web Projects

30 July 2014 - Quick Tip - James Brown - No Comments

Let’s face it, there aren’t many times that we aren’t connected to the Internet while developing web projects. Shoot, I’ve even deployed entire sites from an airplane. Then why is one of the first steps to always setup a URL in your hosts file pointing to 127.0.0.1?

While you can certainly do this, I would recommend starting to put in an A record in your DNS instead. This will enable other developers on your project to quickly get up and running while reducing another step. For example, try pinging the following domain name: localhost.100filmsbluelucy.com. You’ll see that it resolves to 127.0.0.1:

While this might seem like a seemingly trivial tip, anything you can do to reduce the barrier to entry for working on your project is certainly worth doing.

 

Leave a Reply