Clean up dns logic