add function of detecting host info