If the hostname ends with '-', replace the '-' with '0'
Merge pull request #57 from ader1990/hostname-truncate-check

If the hostname ends with '-', replace the '-' with '0'