Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CMCDragonkai/c00969eac6ee8fbb260ceb878128dde5 to your computer and use it in GitHub Desktop.
Save CMCDragonkai/c00969eac6ee8fbb260ceb878128dde5 to your computer and use it in GitHub Desktop.
Reload the DNS Cache in Network Manager

Reload the DNS Cache in Network Manager

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.

@gombossb
Copy link

gombossb commented Nov 8, 2022

Thanks, finally a guide that works and does what its title says

@szpeter80
Copy link

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 use sudo resolvectl flush-caches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment