add demo codes for gethostname