Dns test refactoring