I would like to use the FQDN of the consul nodes for various services unrelated to consul. A random example is when initialising kubernetes and connecting to the etcd cluster, which I’d like to do it using the DNS names instead of the IPs.
I guess the point is that whatever software it’s connecting to Consul is supposed to understand how Consul works. In my case it all (or most of it) goes down to dnsmasq, which redirects requests for company.internal to the consul internal DNS service (on port 8600).
So what I’m looking for is a suggestion of how I can achieve reaching these nodes using the FQDN (node-name.node.domain) or what are the ‘usual’ setups for that. I guess I don’t have the right overview.
There must be something I’m missing, it still doesn’t work, except for the node itself (dig A omni-consul-0.node.comp.internal @127.0.0.1 -p 8600) where I’m running the query (weirdly enough), but this works independently of the anonymous policy.
root@omni-consul-0:~# consul acl token update -id anonymous -policy-name=dns-lookup
Use the -accessor-id parameter to specify token by Accessor ID
AccessorID: 00000000-0000-0000-0000-000000000002
SecretID: anonymous
Description: Anonymous Token
Local: false
Create Time: 2023-03-11 00:45:04.511621809 +0000 UTC
Policies:
d1928b24-f316-bf80-c7ad-fce4311077fc - dns-lookup
Running dig directly on port 8600 for a different node than “omni-consul-0” still returns nothing.
root@omni-consul-0:~# dig A omni-consul-1.node.comp.internal @127.0.0.1 -p 8600 +short
root@omni-consul-0:~#
The second I change ‘deny’ to ‘allow’ (it’s enough to do it only on the server node I’m running the query on, even if there are 3 servers nodes in total), dig works:
root@omni-consul-0:~# dig A omni-consul-1.node.comp.internal @127.0.0.1 -p 8600 +short
10.88.88.216