[Reviewer: Alex] Use shared_ptrs

Matt, can you review this change to use shared pointers in the DNS cache resolver