updated getIPaddress method using referer and dns.gethostentry()