I’m trying to set up systemd-resolved to forward DNS, using the guidance provided here. The catch is that I want all
.consul queries to be directed towards Consul, but all other queries to be directed towards the default nameserver list.
To that end, I have two configuration files:
[Resolve] DNS=127.0.0.1:8600 DNSSEC=false Domains=~consul
[Resolve] DNS=22.214.171.124 126.96.36.199 188.8.131.52 Domains=~.
The reason for having both is because queries to non-
.consul domains fail until I add something for other domains, since I’m symlinking
/etc/resolv.conf to the generated systemd-resolved stub.
Based on what I’m seeing, it works, but only until a non-
.consul domain is queried. Here, it works at first, but only until I query a
damien@nomad-server-ca-central-5a943497:~> sudo service systemd-resolved restart damien@nomad-server-ca-central-5a943497:~> resolvectl query consul.service.consul consul.service.consul: 2600:3c04::f03c:92ff:fe96:a166 -- Information acquired via protocol DNS in 4.7ms. -- Data is authenticated: no damien@nomad-server-ca-central-5a943497:~> resolvectl query google.com google.com: 184.108.40.206 -- link: eth0 2607:f8b0:400b:802::200e -- link: eth0 -- Information acquired via protocol DNS in 6.9ms. -- Data is authenticated: no damien@nomad-server-ca-central-5a943497:~> resolvectl query consul.service.consul consul.service.consul: resolve call failed: 'consul.service.consul' not found
consul.service.consul work reliably until I query a non-
.consul domain, and then it immediately breaks until I restart
Any idea what exactly is happening here? All I want to do really is direct
.consul domains to one set of DNS servers, and all other domains to another. Is that possible with