Adjusted addhostrecord method to handle getting the view as well