I'm having some server in GCP which are using a private DNS server in a private DNS zone (They use consul).
For resolving DNS I'm using the systemd-resolved
, and my resolv.conf
is a soft link to /run/systemd/resolve/stub-resolv.conf
and it's content is:
nameserver 127.0.0.53
options edns0
search c.guardicore-guardicore-mgmt.internal google.internal
So it's mean that all of the DNS requests are forworded to the systemd-resolved daemon. This daemon's configuration is looking like this (The output of systemd-resolve --status
)
Global
DNS Servers: 127.0.0.1 # (consul)
169.254.169.254 # (google's DNS)
What is happening is that when my services try to resolve an DNS record, they query the systemd-resolved
, which is getting answer by the google's DNS server and then this answer got cached in the systemd-resolve
. Google's DNS doesn't know this private DNS, so it's returning NXDOMAIN
answer.
There is a way just to bypass google's DNS? I want the requests just to go through the consul.
I've tried to change the content of the resolv.conf
file, but it kept being ran over by the GCP agent.