MarkusMcNugen / docker-qBittorrentvpn

Docker container which runs a headless qBittorrent client with WebUI and optional OpenVPN
https://hub.docker.com/r/markusmcnugen/qbittorrentvpn/
GNU General Public License v3.0
171 stars 92 forks source link

OpenVPN fails: Cannot resolve host address: sweden-ca-version-2.expressnetw.com #57

Open RocketLR opened 4 years ago

RocketLR commented 4 years ago

I suspect that this is the reason why it wont work:

I can see that in /etc/resolv.conf has too many nameservers. maximum of 3 nameservers should be in there.

The container inherits my servers DNS options and adds the one specified in the docker run command... which adds up to 4 nameservers of which one can not be reached because of how i have my network setup.

cat /etc/resolv.conf nameserver // this address cant be reached via a tunnel interface. nameserver 1.1.1.1 nameserver 8.8.8.8 nameserver 37.235.1.174 // never wanted these? nameserver 8.8.4.4 nameserver 37.235.1.177 // ?

I cant stop systemd-resolved to replace this bad resolv.conf file.

Maybe i could manually add the expressvpn server ip into hosts but thats not really solving this issue.

Any ideas? :( Sorry if im unclear somewhere its very late for me..

RocketLR commented 4 years ago

Fixed it by running it with the --dns flags. like such: docker run --privileged -d \ -v /etc/openvpn/:/config/openvpn/ \ -v /home/androo/datacore/:/downloads \ -e "VPN_ENABLED=yes" \ -e "LAN_NETWORK=192.168.100.0/24" \ --dns 1.1.1.1 \ --dns 1.0.0.1 \ -p 8080:8080 \ -p 8999:8999 \ -p 8999:8999/udp \ markusmcnugen/qbittorrentvpn

It works non but my /etc/resolv.conf file still has a bunch of entries for some reason.. cat /etc/resolv.conf nameserver 1.1.1.1 nameserver 1.0.0.1 nameserver 8.8.8.8 nameserver 37.235.1.174 nameserver 8.8.4.4 nameserver 37.235.1.177

This issue i guess only applies for people who have internal DNS servers on their network. In my case i have my own Internal DNS on a separetad LAN as well..

In conclusion if you are annoying like me, you have to override the inheritance by specifying the flag --dns