Allow ports to be specified for dns resolvers


I'd like to be able to use a local consul agent on the machine to resolve `.consul` domain names for services discovered outside the mesos cluster. The way I'm attempting to do this is by configuring dnsmasq to listen on and direct all lookups for .consul domains to the local consul agent on port 8600.

Unfortunately a couple of things about the way DC/OS works conspire to make this impossible:

1. Resolvers cannot contain a port, only an IP address
2. Preflight Checks prevent anything from listening on port 53 (workaround: disable preflight checks)
3. Choosing,, - causes DNS lookups to fail intermittently depending on which resolver responds first, since google can't resolve `.consul`. (Same problem for any non-local DNS server)
4. Resolvers are the same for both masters and slaves - so I can't choose as my only resolver and have dnsmasq do the actual internet forwarding. Doing so would prevent masters from resolving any internet address because dnsmasq can't run on masters due to spartan requiring port 53 on the masters.

This whole chain of events can be solved by allowing resolvers to optionally specify a port number. so my resolvers would be:

which would allow dnsmasq to run on all servers, on a non-conflicting port, and not get caught by preflight checks or otherwise be prevented from working on all servers.


Brian Mitchell
August 5, 2016, 9:02 PM

I've opened a PR against Spartan to support parsing this from JSON:

The only other assumption is that it gets passed along properly from the original YAML.


Sargun Dhillon