In Android we have applications like daedalus which is a local VPN (Not remote) and used to change DNS quickly. I need such way in Ubuntu in order to change DNS whenever needed.
Do we have any way to create such VPN which doesn't make remote tunnel and just changes DNS? Or any other way to switch DNS servers as I need to switch my DNS frequently.
The possible way to do it is:
Disable DNS cache (for example, this way https://tecadmin.net/disable-local-dns-caching-ubuntu/)
Change your connection to "Automatic (addresses only)"
Add your DNS and then change it.
Another way is to create your own local DNS which will redirect you to another one, set it as your default DNS and then just change setting of your local DNS. But it's not too easy.
In Android VPN is probably needed because you can't access network settings directly.
One more way is to do it with network-manager console client like this:
Note: Replace
eth0
by name of your network interface if needed.You can also create bash aliases for these commands, appending following lines to
~/.bashrc
And the use them like this:
I did it this way:
/bin/dnsme:
/bin/undnsme:
in /etc/resolv-dnsme.conf: