deepjyoti30 / blog-comments

Comments for my personal blog
0 stars 0 forks source link

openvpn-dns-leak #4

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Prevent DNS Leak with OpenVPN on Linux | Deepjyoti Barman

How to get rid of DNS Leak while using OpenVPN with any VPN provider on Linux

https://blog.deepjyoti30.dev/openvpn-dns-leak

raulseed commented 3 years ago

hey thank you so much for both threads on the VPN setup with surfshark. I am having an issue though, I don't know where to place lines in the vpn.conf file.

where exactly should we add those lines ? after or before the auth-user-pass line ?

It's giving me an error.

raulseed commented 3 years ago

nevermind I was able to figure it out ! I entered this right after the line that says "reneg-sec 0" in the first chunk of lines. I'm a newbie to linux so not sure if the order matters but that is where it worked for me.

I actually entered:

setenv /usr/bin/update-systemd-resolved up /usr/bin/update-systemd-resolved up-restart down /usr/bin/update-systemd-resolved down-pre

then i saved the file, rebooted and now the DNS leaks and VPN both boot with the computer.

I just wanted to say your guide was a godsend and I had lots of fun trying to figure it out.

Thank you for making them.

CodenameFulcrum commented 3 years ago

I just want to add, based on my recent experience, that some users DNS leaks may be caused by Firefox (or possibly another browser) and unrelated to OpenVPN, Linux, Windows, etc.

Your article, while great, did not fix my DNS leak because it was being caused by Firefox itself! I spent over a week troubleshooting my DNS leak and tried many different solutions to no avail. It was extremely frustrating! No matter what I tried, I still had the leak.

One thing I eventually picked up on, was that my DNS leak was to a set of CloudFlare DNS servers in Hong Kong (oddly enough) rather than my ISP or Quad9 (which I use on my network router). After looking at Firefox's Network settings (Search for Network in Settings, then click on the "Settings" button and it brings up a "Connection Settings" menu ), I noticed CloudFlare was selected as the "Use Provider" under "Enable DNS over HTTPS". There, I changed the setting to "Custom" and added Quad 9's DNS server (9.9.9.9). I then checked the box next to "Proxy DNS when using SOCKS v5" and BOOM, problem solved! No more DNS leaks!

Hopefully this will save others from hours of frustration.

Lastly, thanks for your article. Even though it didn't solve my issue, it did teach me quite a bit during the process!

shyuy commented 9 months ago

I just want to say thank you for this because it helped so much but also a thing i ran into was that i got an error "update-systemd-resolved[237948]: 'busctl' exited with status 1" which i solved by starting update-systemd-resolved. I was stuck on this for so long for a dumb reason.