DNS unit tests & associated bugfixes