Disconnecting VPN breaks DNS [solved]

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
zebbeman

Disconnecting VPN breaks DNS [solved]

Post by zebbeman »

Hi,
When I disconnect my VPN, the original DNS is not restored, leaving me with no DNS (can only access IP addresses and hosts configured domains) . I have this issue with 19.0 and 19.1. The fast fix is to disconnect my Ethernet and reconnect. Does anyone know why this is happening?

I have a "normal" Ethernet with static IP, GW, and DNS.

My VPN is PPTP "Automatic (VPN)".
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
mrmajik45

Re: Disconnecting VPN breaks DNS

Post by mrmajik45 »

Use https://1.1.1.1 DNS. (Until we give a fix or you're satisfied.)
zebbeman

Re: Disconnecting VPN breaks DNS

Post by zebbeman »

I cannot type letters (https) in the dns field - is that what you meant?
mrmajik45

Re: Disconnecting VPN breaks DNS

Post by mrmajik45 »

Click the link. And click on Linux for setting up the DNS. It's basically a DNS with VPN built in.
Direct steps: https://developers.cloudflare.com/1.1.1 ... 1.1/linux/
zebbeman

Re: Disconnecting VPN breaks DNS

Post by zebbeman »

I do not want to change DNS, is that what you are suggesting? How would that change the fact that the DNS is not restored after disconnecting the VPN?
mrmajik45

Re: Disconnecting VPN breaks DNS

Post by mrmajik45 »

I mean you can use a DNS which hides your IP. Until someone more tech savvy here can help.
zebbeman

Re: Disconnecting VPN breaks DNS

Post by zebbeman »

Aah, got it, it is not that kind of VPN :-) Thanks for the tip though
mrmajik45

Re: Disconnecting VPN breaks DNS

Post by mrmajik45 »

What are you using it for?
nina22

Re: Disconnecting VPN breaks DNS

Post by nina22 »

change the fact that the DNS is not restored after disconnecting the VPN?
EdgarNo

Re: Disconnecting VPN breaks DNS

Post by EdgarNo »

What VPN provider are you using? Has it been updated recently? Might be a bug in some recent fix and a question for their customer support. The DNS can be cashed in browser too, try turning different browser on after turning VPN off and check if the problem still there.
zebbeman

Re: Disconnecting VPN breaks DNS

Post by zebbeman »

It is a private PPTP and it works with mint 17.3 (and a bunch of other client computers) but not in mint 19.0/19.1.

It is not a browser issue, since I cannot ping/access fqdn, unless locally configured, after disconnecting the PPTP VPN client.

I can disconnect from an OpenVPN connection so I have this issue with PPTP only.
GamesBond
Level 1
Level 1
Posts: 15
Joined: Sun Dec 15, 2013 4:22 am

Re: Disconnecting VPN breaks DNS

Post by GamesBond »

Having the same issue when I use PPTP but also when using L2TP over IPSEC, somehow Mint doesn't restore / reload the orignal settings for DNS. Indeed disabling WiFi and re-enabling is the quick fix but it's a little annoying bug. Bug confirmed on 5 different LM 19 / 19.1 machines.
dkosovic
Level 1
Level 1
Posts: 6
Joined: Thu Mar 22, 2018 8:45 am

Re: Disconnecting VPN breaks DNS

Post by dkosovic »

I believe this is related to Ubuntu bug LP: 1778946 which breaks DNS resolution after disconnecting VPN connections, but only VPN clients that use pppd such as nm-pptp and nm-l2tp.

A workaround is to install the resolvconf package :
sudo apt install resolvconf

If you are using network-manager-l2tp, I would recommend using the latest version from the following PPA: which has a number of bug fixes and enhancements.
User avatar
thierrite
Level 1
Level 1
Posts: 27
Joined: Sun Oct 20, 2019 10:36 am

Re: Disconnecting VPN breaks DNS

Post by thierrite »

Maybe a bit 'off topic', but IPv6 and PPTP shall not be recommended for VPN from what I've read.

Also, once VPN is disconected if preferable you get fully disconnected to avoid your real IP to go into the wild.
I've read few things here (not yet fully tested), which basically show you how to configure IPtable rules to have a 'kill switch' once your VPN connection fails:
http://forums.debian.net/viewtopic.php?t=108381
and
https://linuxconfig.org/how-to-create-a ... s-on-linux

First link is a longer post, with more details provided by one guy, M51, with great details.
zebbeman

Re: Disconnecting VPN breaks DNS

Post by zebbeman »

Thanks dkosovic! resolvconf did the trick!

As GamesBond said, L2TP behaves the same way.

Thanks for the tips thierrite, I do not use ipv6. Also, I am not using VPN for hiding, I am accessing private networks, you know the original purpose of VPN :D

Note: It does not go away upon upgrades, it has the same behaviour in 19, 19.1, 19.2, 19.3

Thanks!
Locked

Return to “Networking”