Flush linux DNS cache

Wed, Sep 13, 2023 One-minute read

Flush linux DNS cache

TIL how to flush my local DNS cache in Ubuntu.

# check if cache is populated
resolvectl statistics
# flush cache
resolvectl flush-caches
# confirm, cache should say 0
resolvectl statistics

I was doing some local testing with cloud providers, I switched from one VPS provider to another but kept the same subdomain. This was causing curl and Go.http errors. Flusing the cache fixed it.

Tags:

#go #dns #curl