fix dns query function