Introduce interface to separate DNS handling

In order to test the DNS handling in isolation from any consul
interaction, introduce an interface.