How can I flush the DNS on Ubuntu 17.04?
I seem to have a few DNS issues at the moment since upgrading to 17.04 from 16.10 and went to flush the DNS but I can't find how to.
Can anyone tell me please?
How can I flush the DNS on Ubuntu 17.04?
I seem to have a few DNS issues at the moment since upgrading to 17.04 from 16.10 and went to flush the DNS but I can't find how to.
Can anyone tell me please?
You may use this command:
sudo systemd-resolve --flush-caches
To verify that flush was sucessfull, use:
sudo systemd-resolve --statistics
Sample output:
This command should restart the local name service and flush the local DNS cache:
There is probably a way of getting it to just flush the cache instead of restart, but restart suited my purposes.
I made this: https://github.com/dunderrrrrr/dnscache
Maybe thats what youre looking for.
Installation
Usage
There are two arguments that can be passed to the script, clear or stats. Both of them should be self explanatory.