Add support for different ways to get the hostname.
Merge pull request #14 from miceno/feature/hostname

Add support for different ways to get the hostname.