proposal for trac3636

This is a proposal for trac3636, i've added a flag in order to avoid the dot append on hostname option.

For a non fqdn value in hostname option, an appended dot causes error on some devices (at least telephony devices) 

Intention is to keep the same behavior as before, and only avoid this dot append when hostname option is present and it´s not an FQDN.

Modified the unittest too.