New get_hostname method