lightbody/browsermob-proxy — pull request #45 by achingbrain (2013-11-08 12:05:04+00:00)
Title: fallback to InetAddress.getByName when dnsjava lookup fails

I've run into a problem - I've got a bunch of testing hosts defined in my `/etc/hosts` file but every time I run JBehave with browsermob-proxy it fails with an UnknownHostException - the reason is that dnsjava (which BrowserMobHostNameResolver appears to use classes from) doesn't respect the hosts file.

InetAddress.getByName(String host) on the other hand does, so the changes in this pull request enable BrowserMobHostNameResolver to fall back to InetAddress.getByName when a lookup using dnsjava fails.

I've also added unit tests to verify the functionality.

Happy to discuss and amend.