You are not logged in.

#1 2023-09-04 04:21:28

genji
Member
Registered: 2023-08-13
Posts: 47

Is there a way to make 'piactl' stop overwriting my DNS servers?

Hi all, quick question, I installed the piavpn-bin package from AUR and its all working fine except one nuisance is every time 'piactl connect' is completed, it's overwriting the /etc/resolv.conf with it's own values..  This isn't really atypical behavior in most VPN apps but what IS atypical is not having any kind of way I can find to set your own.  in NordVPN etc you can always specify to use your DNS or not but I can't find a way to do it with PIA VPN.  I run a Pi Hole here at home and want to direct all queries through it, instead of PIA.  I can just edit /etc/resolv.conf and change it to 192.168.0.X and it works fine, but how do I stop that file from being overwritten by piactl?

Before I run it, it is correct, and says generated by NetworkManager in the comments.  I want it to stay this way!

Thanks very Much!

Offline

#2 2023-09-04 08:28:23

seth
Member
Registered: 2012-09-03
Posts: 58,174

Re: Is there a way to make 'piactl' stop overwriting my DNS servers?

chattr +i /etc/resolv.conf

will prevent changes to that file and shows up in https://wiki.archlinux.org/title/Privat … ng_PIA_DNS - though the discussed problem there looks different, you can protect the file against any changes this way.

Offline

#3 2023-09-04 16:51:05

genji
Member
Registered: 2023-08-13
Posts: 47

Re: Is there a way to make 'piactl' stop overwriting my DNS servers?

Hi seth and thanks kindly for responding

I tried that command and unfortunately piactl refuses to do anythihng further once that file is locked!  Unbelievable!  It will not connect at all until it has the ability to forcefully overwrite my resolv.conf apparently.  There is no error output anywhere but `journalctl -e` shows it's creating a bunch of devices for no reason, like up to 50 of them, all named wgpia0 but the device never stays up.  As soon as i `chattr -i /etc/resolv.conf` within seconds the device goes up, traffic works fine, and of course, my DNS servers are once again wiped out.

It's crazy how determined this thing seems to be to use it's own DNS servers..  I want to use my own!

Offline

#4 2023-09-04 18:31:53

seth
Member
Registered: 2012-09-03
Posts: 58,174

Re: Is there a way to make 'piactl' stop overwriting my DNS servers?

https://helpdesk.privateinternetaccess. … ers-in-app

Otherwise let's see

stat /etc/resolv.conf

As last resort you could inotifywatch the file and reset it after every change.

Offline

#5 2023-09-04 19:42:41

genji
Member
Registered: 2023-08-13
Posts: 47

Re: Is there a way to make 'piactl' stop overwriting my DNS servers?

I had to install Xorg, and then use their GUI app to log in again and then inside the GUI app you can specify the DNS servers, as a comment in the AUR piavpn-bin had mentioned as a possibility

Hardly a good solution though - this machine is now super bloated and stuck running X server full time.  It sounds like it's ONLY changeable inside their GUI app which is extremely frustrating and pointless as far as I can tell..  Thanks for your help!

I wouldn't mark this solved as it's not a good solution, and I'd love to hear from someone else if they figure out how to do this with just CLI tool

Last edited by genji (2023-09-04 19:44:02)

Offline

#6 2023-09-04 19:50:28

seth
Member
Registered: 2012-09-03
Posts: 58,174

Re: Is there a way to make 'piactl' stop overwriting my DNS servers?

The GUI certainly writes some config?
You could strace it to locate that config file hmm

Offline

#7 2023-09-04 21:34:07

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,474

Re: Is there a way to make 'piactl' stop overwriting my DNS servers?

In their support pia details manual connection scripts.
In the final section "ONE-LINE CALLS" they describe a one-liner to connect manually and it includes a variable "PIA_DNS=TRUE". I'd try that with "PIA_DNS=FALSE".

Offline

#8 2024-01-13 14:04:21

just-one-post-then-dip
Member
Registered: 2024-01-13
Posts: 1

Re: Is there a way to make 'piactl' stop overwriting my DNS servers?

This can be set by modifying settings.json in /opt/piavpn/etc/. Several other settings that aren't made available through the cli can be set there too (if you can work out the right variable to set. I had got to the point of installing a VM with a gui and watching what they change to as I set them).

If you don't want PIA to touch your DNS at all, set overrideDNS to ""

If you want it to set it to a specific address, set it to, for example, "1.1.1.1" or ["1.1.1.1", "8.8.8.8"] (max 2)

You can also modify all of these settings directly from the cli with the -u (unstable) flag. The syntax is:

piactl -u applysettings '{"variabale":"value"}'

so piactl -u applysettings '{"overrideDNS":""}' or piactl -u applysettings '{"overrideDNS":["1.1.1.1", "8.8.8.8"]}'

Hope this helps. Stumbled across your post in my own search so thought I'd come back and add the answer in.

Last edited by just-one-post-then-dip (2024-01-13 14:05:24)

Offline

Board footer

Powered by FluxBB