implement hostname function