Resolve localhost to 127.0.0.1 without using DNS

Signed-off-by: Andrei Dinin <adinin@pivotal.io>
Yea, a return would be better.

We added the test which required a refactor to use cmdRunner instead. (It was using the exec package before)