mullvadvpn-app icon indicating copy to clipboard operation
mullvadvpn-app copied to clipboard

feature: keeping system DNS unchanged or use custom DNS

Open codl opened this issue 6 years ago • 112 comments

hi, I have a local DNS resolver for caching reasons and I want to keep using it when I enable mullvad, but the daemon changes resolv.conf without asking and even monitors it and reverts it every time it is changed. I couldn't find a way to disable this

could an option be added to disable this behaviour?

codl avatar Sep 26 '18 01:09 codl

We have plans on adding a feature to make the app set a custom DNS resolver. But I'm unsure we want to disable its DNS setting/monitoring completely. The app is fully responsible for the system security and our job is to try to protect the privacy of the people using it. Leaking DNS is terrible for privacy, so it's not something we want to make it too easy for users to do.

faern avatar Sep 26 '18 06:09 faern

being able to set a custom DNS would fix my problem either way

codl avatar Sep 26 '18 16:09 codl

Hi, I'm using a Raspberry Pi with Pi-Hole as a DNS server to filter out ad-related lookups. I have my router configured to set the IP of the RPi as DNS on my network over DHCP, but when starting the Mullvad client, the DNS is changed to e.g. 10.11.0.1.

An option to configure the DNS manually would be very much appreciated!

Side note/question: Is using the Mullvad DNS at 193.138.219.228 as safe as using the one available on each VPN server (e.g. 10.11.0.1)?

akej74 avatar Sep 29 '18 13:09 akej74

@akej74 Yes, the public DNS on that IP is still supported. As explained in our DNS leak guide (under Other users) all requests to it will actually be hijacked and redirected to the DNS resolver running on each VPN server when you are connected to Mullvad. So in practice, using 193.138.219.228 as your DNS through the tunnel effectively becomes equivalent to using the DNS available at the VPN server you are connected to. https://mullvad.net/en/guides/dns-leaks/

faern avatar Oct 01 '18 07:10 faern

Hi, just a quick question on the topic of adding a custom DNS setting in the Mullvad app, is this something that is on the roadmap? If not, I need to rely on the OpenVPN app, but I would prefer the Mullvad app.

akej74 avatar Feb 02 '19 12:02 akej74

It is on the roadmap. But I don't have a time frame for it currently. It's not part of what we are working on at the moment.

faern avatar Feb 02 '19 14:02 faern

I've just spent 5 minutes or so trying to figure out why I couldn't reach any websites. Of course, I eventually checked the resolv.conf and realised that the Mullvad client must have changed it.

I'm alright with Mullvad changing it, but there needs to be some kind of notice to users that if the VPN is unexpectedly killed, the resolv.conf won't be changed back. In fact, why can't the original DNS configuration be stored somewhere, and have mullvad-daemon change it back when the VPN is not active?

cedws avatar Feb 02 '19 16:02 cedws

mullvad-daemon does restore the DNS when it's instructed to disconnect. What is it that you mean is unexpectedly killed? mullvad-daemon or OpenVPN? If OpenVPN dies unexpectedly then mullvad-daemon will directly try to start it again. Killing OpenVPN will not make the Mullvad VPN become disconnected, it will just make it retry connecting. For mullvad-daemon to stop trying and restore your system settings to use the internet unencrypted, you need to instruct Mullvad VPN to disconnect.

If you mean that mullvad-daemon is unexpectedly killed and that does not restore your settings then I say it depends a lot on the circumstances and your platform etc.

EDIT: @c-edw If you believe what you are experiencing to be a bug, then please file an issue on that. This issue is about something else, so let's keep them separate.

faern avatar Feb 02 '19 16:02 faern

My laptop battery died while I was connected. I guess it could be considered a bug - it depends on whether the client is supposed to restore the DNS settings in this case.

cedws avatar Feb 02 '19 17:02 cedws

@c-edw It should indeed have restored the DNS automatically on reboot. We have four different ways of managing DNS depending on what services are available on your distro etc. If you can reproduce the problem it would be awesome if you could send a problem report to our support through the app.

faern avatar Feb 02 '19 18:02 faern

+1 for me. Because it overrides my local DNS server I loose all connectivity to the other servers in my local domain which results in me being unable to logon (AD Domain), unable to access file shares, etc. I understand why you would want to to do this but in my use case it makes the service useless.

I would very much like the ability to set the DNS on the VPN adapter to Mullvad but please make it optional to change all DNS server addresses on all network cards.

Rouzax avatar Feb 14 '19 13:02 Rouzax

+1

Really needed feature for pi-hole users.

aalhitennf avatar Apr 27 '19 14:04 aalhitennf

You can work around this by installing OpenVPN and creating connection files through Mullvad.

Rouzax avatar Apr 27 '19 14:04 Rouzax

+1 I'm a Pi-Hole user and I'd love to be able to use it together with the (awesome) Mullvad app. Until then, I guess I'll work around this by using OpenVPN.

sfreyux avatar Apr 28 '19 14:04 sfreyux

This is how I set up my OpenVPN client configuration to use a custom, local DNS server (Pi-hole):

#block-outside-dns
pull-filter ignore "dhcp-option DNS"
dhcp-option DNS <local dns ip>

jelbo avatar Jun 02 '19 12:06 jelbo

This is how I set up my OpenVPN client configuration to use a custom, local DNS server (Pi-hole):

#block-outside-dns
pull-filter ignore "dhcp-option DNS"
dhcp-option DNS <local dns ip>

Anyone knows if the same works for OpenVPN Connect on iOS? Where local dns ip means local network and not localhost. (I want to use my PiHole DNS server when at home.)

Download the .ovpn files from Mullvad’s config page, open in editor, add these two lines, securely send the files to iOS device … tried it, cannot really confirm if it works … but seems it doesn’t.

fooness avatar Jun 21 '19 09:06 fooness

+1, would love if this is also possible in Wireguard and not only OpenVPN

DjCrays avatar Aug 14 '19 20:08 DjCrays

+1, this feature would be killer for PiHole users!

juliangaal avatar Aug 30 '19 14:08 juliangaal

+2 if Mullvad could provide ads blocking DNS on their side insead of relying on Pi-Hole

sheevy avatar Sep 11 '19 23:09 sheevy

Would be great if it supported DNS-over-TLS, but I guess it must be implemented on Wireguard first.

semente avatar Dec 04 '19 18:12 semente

I've just figure out how to use DNS-over-TLS on a Wireguard connection:

(It may not apply to Mullvad apps, only official Wireguard software for GNU/Linux and Android)

On GNU/Linux system you must install and setup unbound or stubby software with the DNS-over-TLS service of your choice (e.g NextDNS.io), then set your /etc/resolv.conf to 127.0.0.1 and remove the DNS option from your Wireguard configuration (or just set it to DNS = 127.0.0.1)

On Android 9 or later, use the Wireguard official app to connect to Mullvad. Set the the DNS option of the desired VPN configuration to blank. It will make it use Android system's DNS. Go to Settings > Network > Advanced > Private DNS and set it to the DNS-over-TLS service of your choice.

I would suggest Mullvad developers to provide an option to "Use system DNS" on their apps. Thanks

semente avatar Dec 05 '19 16:12 semente

Having the client prepend a nameserver 127.0.0.1 to /etc/resolv.conf would already help to prevent killing many automated development environments that run a local DNS resolver and would also provide a "hook" for more advanced user to use for their custom DNS needs.

Correct me if I'm worong but adding localhost as a DNS sever usually should not leak any DNS to the outside world.

tobias-kuendig avatar Dec 24 '19 05:12 tobias-kuendig

Option to personalize DNS resolver is definitely something missing in Mullvad VPN, particularly if you you want to use DNS including ADBlocking. I actually use Mullvad for the Wireguard compatibility and the hope of the DNS resolver option, but if this option is not implemented soon, sure that i will swap to another VPN provider, sorry to say that. Is it something so hard to implement ? Thanks in advance for understanding, and thanks for the great job you've already done. In the hope you'll solve that soon ...

FilipoMoake avatar Feb 16 '20 06:02 FilipoMoake

+1 for this option in order to allow pi-hole or other custom ad blocker. thanks for the hard work mullvad team

techwoes avatar Feb 29 '20 21:02 techwoes

If you're using wireguard, shouldn't it be as easy as setting DNS in the client config to a custom server? They are normally in /etc/wireguard/*.conf, at least if you setup wireguard yourself. Not sure about where the mullvad app places the configs

juliangaal avatar Mar 02 '20 08:03 juliangaal

+1 on this for sure

techwoes avatar Mar 13 '20 12:03 techwoes

+1 here, cant use Mulvad while using Pihole

p1r473 avatar Mar 15 '20 22:03 p1r473

This would be a great feature. I am keen to use NextDNS alongside the Mullvad VPN app. I could use the Wireguard app to set a different DNS resolver, but the functionality inside the Mullvad app would be my preference.

MitchellCash avatar Mar 30 '20 08:03 MitchellCash

+1 here, cant use Mulvad while using Pihole

Are you using wireguard with mullvad @p1r473 ? I think there may be a way to get to use both

juliangaal avatar Apr 01 '20 08:04 juliangaal

+1

scafroglia93 avatar Apr 02 '20 06:04 scafroglia93