Perhaps this is more of a question about how to correctly use network tools on macOS than about Consul DNS. But I think that Consul DNS is nuanced enough that this should probably be the place to get an answer.
I am trying to setup the dev machines in my office so that we can make DNS requests from our dev machines (macOS) to our Consul clusters. Our dev machines are not running any Consul agents.
I setup a domain file at: /etc/resolver/consul
The contents of that file look like this:
nameserver 171.21.1.11
nameserver 171.21.1.12
nameserver 171.21.2.11
nameserver 171.21.2.12
port 8600
There are entries for each server in each cluster. We have multiple datacenters with a cluster in each.
Here are some queries that work:
dig @172.28.1.11 -p 8600 public.SERVICENAME.service.DATACENTERNAME.consul => success
dig @172.28.1.11 -p 8600 public.SERVICENAME.service.consul => success
ping SERVICENAME.service.consul => success
ping TAG.SERVICENAME.service.consul => success
ping SERVICENAME => works with "service.consul" in the search-domain
Here are queries that do not work:
nslookup public.liveaddress-us-street-api.service.linode-dallas.consul => NXDOMAIN
nslookup liveaddress-us-street-api.service.linode-dallas.consul => NXDOMAIN
nslookup liveaddress-us-street-api.service.consul => NXDOMAIN
dig SERVICENAME.service.consul => NXDOMAIN
dig SERVICENAME.service.DATACENTER.consul => NXDOMAIN
host service.consul => NXDOMAIN
host SERVICENAME.service.consul => NXDOMAIN
host SERVICENAME.service.DATACENTER.consul => NXDOMAIN
What am I doing wrong with these?
It appears that I can dig when I specify a server and a port, but then why even have the /etc/resolver/consul file?
I am open to any tips or directions.
Thank you.