openpyn-nordvpn icon indicating copy to clipboard operation
openpyn-nordvpn copied to clipboard

RuntimeError: Invalid configuration: systemd-resolved is running, but resolv.conf contains ['8.8.8.8', '8.8.4.4', '208.67.222.222']

Open fossil opened this issue 6 years ago • 4 comments

if the list of dns servers specified in cat /etc/network/interfaces

auto lo iface lo inet loopback dns-nameservers 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 82.200.69.80 84.200.70.40 NetworkManager puts the first 3 addresses to /etc/resolv.conf This is perfectly legal. openpyn process this case not properly and throws an exception.

Traceback (most recent call last): File "/usr/local/bin/openpyn", line 11, in sys.exit(main()) File "/usr/local/lib/python3.6/dist-packages/openpyn/openpyn.py", line 130, in main args.skip_dns_patch, args.silent, args.nvram, args.openvpn_options) File "/usr/local/lib/python3.6/dist-packages/openpyn/openpyn.py", line 323, in run connect(aserver, port, silent, test, skip_dns_patch, openvpn_options) File "/usr/local/lib/python3.6/dist-packages/openpyn/openpyn.py", line 777, in connect use_systemd_resolved = uses_systemd_resolved() File "/usr/local/lib/python3.6/dist-packages/openpyn/openpyn.py", line 728, in uses_systemd_resolved "Invalid configuration: systemd-resolved is running, but resolv.conf contains {}".format(dns_servers)) RuntimeError: Invalid configuration: systemd-resolved is running, but resolv.conf contains ['8.8.8.8', '8.8.4.4', '208.67.222.222']

fossil avatar Aug 15 '18 20:08 fossil

Hi, Could you let me know what OS is this and if you have made any relevant modifications (like manually installed systemd-resolved or resolvconf). And could you please test it now and see if it works ok. also if there's dns leak or not. Try the -f option.

jotyGill avatar Aug 16 '18 07:08 jotyGill

Hi,

I upgraded from ubuntu 16.04.3 to 18.04.1 This upgraded python 3.5 to 3.6 and openpyn is not found anymore by default python 3.6. I installed it again and initialised as described in README.md on github. I'm starting openpyn with batch located in ~/bin/, which run the command openpyn ch -t 10 --p2p -f This command fails with the message I mentioned in the bug report. The only modification I made is in /etc/networking/interfaces

interfaces(5) file used by ifup(8) and ifdown(8)

auto lo iface lo inet loopback

dns-nameservers 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 82.200.69.80 84.200.70.40

I added dns-nameservers, because I don't want to use dns provided by my ISP, but from google and open dns.

Networkmanager, which manages the network interfaces and connections under ubuntu automatically populates the resolv.conf

$ ls /etc/resolv.conf -l lrwxrwxrwx 1 root root 29 Aug 22 2016 /etc/resolv.conf -> ../run/resolvconf/resolv.conf

either with dns from ISP or explicit dns servers from interfaces. dns-servers from interfaces has highest priority.

I didn't made any additional settings or modifications of systemd-resolved

How can I check the dns leaking?

From my understanding, after connecting to nordvpn the 127.0.0.53 has to be used as dns server. it is serviced by systemd-resolved. And then it should talk to the nordvpn dns instead of using dns-servers settings from the interfaces. is that correct?

Take care, Victor

чт, 16 авг. 2018 г. в 9:16, jotyGill [email protected]:

Hi, Could you let me know what OS is this and if you have made any relevant modifications (like manually installed systemd-resolved or resolvconf). And could you please test it now and see if it works ok. also if there's dns leak or not. Try the -f option.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jotyGill/openpyn-nordvpn/issues/180#issuecomment-413449677, or mute the thread https://github.com/notifications/unsubscribe-auth/ABF86Rt5gIj1ZHhAks5jF0fu_4cUCDDTks5uRRxGgaJpZM4V-v8k .

fossil avatar Aug 16 '18 19:08 fossil

Hi,

I updated openpyn to 2.7.1 it asked me to init it again. why it doesn't detect and doesn't use the settings from previous version?

now it starts fine.

openpyn ch -t 10 --p2p -f

I checked the dns leaking using

https://www.dnsleaktest.com/results.html

and it shows the following info:

IPHostnameISPCountry 185.236.201.142 no-mans-land.m247.com M247 Europe SRL Switzerland if I connected to nl nordvpn server, it shows that

IPHostnameISPCountry 109.236.94.15 customer.worldstream.nl WorldStream B.V. Netherlands however, if i run nslookup locally, it returns answer from google

$ nslookup yahoo.com Server: 8.8.8.8 Address: 8.8.8.8#53

Non-authoritative answer: Name: yahoo.com Address: 98.138.219.231 Name: yahoo.com Address: 98.137.246.8 Name: yahoo.com Address: 98.138.219.232 Name: yahoo.com ... Name: yahoo.com Address: 2001:4998:c:1023::4

Take care, Victor

PS% have you fixed the re-connection problem after standby mode and the connection get lost (switching to another wifi network)? after I drop down the wifi and reconnect openpyn doesn't detect this and doesn't restore the connection

чт, 16 авг. 2018 г. в 9:16, jotyGill [email protected]:

Hi, Could you let me know what OS is this and if you have made any relevant modifications (like manually installed systemd-resolved or resolvconf). And could you please test it now and see if it works ok. also if there's dns leak or not. Try the -f option.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jotyGill/openpyn-nordvpn/issues/180#issuecomment-413449677, or mute the thread https://github.com/notifications/unsubscribe-auth/ABF86Rt5gIj1ZHhAks5jF0fu_4cUCDDTks5uRRxGgaJpZM4V-v8k .

fossil avatar Aug 16 '18 20:08 fossil

Hi Victor, "From my understanding, after connecting to nordvpn the 127.0.0.53 has to be used as dns server." with systemd resolved, I believe so. "it asked me to init it again." that should be os dependent thing. I just tested on a Ubuntu 16.04. it didn't delete the old config after update. I test the dns leak by using wireshark to see if the dns traffic is going through the tunnel. The dns server it uses doesn't matter much as long as the traffic is not going through the regular route.

The "re-connection problem after standby mode" is really openvpn's issue, as the control is given to it by that time. If openvpn exits then openpyn would handle it by trying again using a different server. but openvpn doesn't complain right away it's hard to deal with it. NordVPN servers dont seem to respect user settings in that in which we can tell openvpn to drop connection if idle for a short period of time. I think from memory there setting was to wait a couple of 180 second cycles and then drop the connection. It would require some sort of periodic connectivity checks then forcefully dropping connections from our end.

Cheers, Gill

jotyGill avatar Aug 20 '18 04:08 jotyGill