develop the dns query function