changed to use user_data for setting public dns name as its hostname.