add a class for getting hostname.