1

I have changed the IP address in a DNS record (on Google Cloud DNS), associated to a subdomain test.example.com

From my Google Cloud VM:

  • if I ping test.example.com, I get the old IP address
  • if I systemd-resolve test.example.com, I get the new IP address

I have tried to flush the DNS cache using:

sudo systemd-resolve --flush-caches

but ping is still getting the old IP address

What am I doing wrong?

Daniele B
  • 387

1 Answers1

1

Behavior you observed comes from a known systemd bug - I dare to say that since you indicated that you have nameserver 127.0.0.53 in your /etc/resolv.conf - systemd adds it due to mentioned bug. Have a look at the answers provided since they may contain a solution that's right for you. Most of them however suggest to "hardcode" DNS.

Ping works in a different way and it was able to resolve the name correctly.

Inner workings related to DNS and systemd-resolve were discussed at length here.

Wojtek_B
  • 1,113