fixed #11

Use fqdn when it's available else hostname
Merge pull request #13 from Eleme/master

Fix fqdn nil bug