Don't crash if there is a DNS hiccup.
Move exceptional case to top of method.  Return null if connection could not be made.
Merge pull request #28 from nurikabe/master

Don't crash if there is a DNS hiccup.