Add newdomain message type, refactor dnsdedupe code to be more portable