You may be using NetworkManager with dnsmasq
as the DNS plugin. If so, it's being used as a local caching nameserver.
When its data is outdated, you can force it to reload its DNS cache with:
Use:
nmcli general reload dns-full
You can also use:
nmcli general reload
Which will reload all network manager configuration.
On Ubuntu 22.04.1 the reload works but dns cache is not cleared.
For older Ubuntus
sudo systemd-resolve --flush-caches
might work, on 22.04 one may usesudo resolvectl flush-caches