Coder ran on a machine with VPN can't resolve the hostname

I moved Coder to run on my main system which has a Proton VPN up and running. It's a regular Ubuntu. So when I run Coder (through docker compose), starting a workspace doesn't work. My workspace container logs:
+ curl -fsSL --compressed http://funny_hostname:7080/bin/coder-linux-amd64 -o coder
curl: (6) Could not resolve host: funny_hostname
+ status=6
+ echo error: failed to download coder agent
+ echo command returned: 6
+ echo Trying again in 30 seconds...
+ sleep 30
error: failed to download coder agent
+ curl -fsSL --compressed http://funny_hostname:7080/bin/coder-linux-amd64 -o coder
curl: (6) Could not resolve host: funny_hostname
+ status=6
+ echo error: failed to download coder agent
+ echo command returned: 6
+ echo Trying again in 30 seconds...
+ sleep 30
error: failed to download coder agent
Once I disable the VPN, it finds host from the container:
root ➜ / $ ping funny_hostname
PING funny_hostname (192.168.0.31) 56(84) bytes of data.
64 bytes from funny_hostname (192.168.0.31): icmp_seq=1 ttl=64 time=0.045 ms
64 bytes from funny_hostname (192.168.0.31): icmp_seq=2 ttl=64 time=0.030 ms
root ➜ / $ ping funny_hostname
PING funny_hostname (192.168.0.31) 56(84) bytes of data.
64 bytes from funny_hostname (192.168.0.31): icmp_seq=1 ttl=64 time=0.045 ms
64 bytes from funny_hostname (192.168.0.31): icmp_seq=2 ttl=64 time=0.030 ms
What options do I have? I'd love to split tunnel the VPN so that Coder doesn't use it - but I don't know how to do it.
5 Replies
Codercord
Codercord4w ago
<#1325230682330497034>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Some Dinosaur
Some DinosaurOP3w ago
I can ping the host through the raw local ip address - so it's just the name resolution that fails.
Syrelash
Syrelash3w ago
Vpns tend to override dns settings and put their route to the highest priority. If it supports split tunneling like Mullvad I’d recommend doing that.
Phorcys
Phorcys3w ago
@Some Dinosaur you should be able to use something like https://github.com/qdm12/gluetun
GitHub
GitHub - qdm12/gluetun: VPN client in a thin Docker container for m...
VPN client in a thin Docker container for multiple VPN providers, written in Go, and using OpenVPN or Wireguard, DNS over TLS, with a few proxy servers built-in. - qdm12/gluetun
Some Dinosaur
Some DinosaurOP3w ago
I'm trying to set up my own DNS that I'd force the VPN to use, hoping that the name will resolve to the IP. Instead of hoping for host-name resolution I will have my own tables... maybe that works we'll see

Did you find this page helpful?