Hi! I tried to connect to a db instance using wireguard, and here’s the steps taken:
- activate wireguard
- fly proxy 5432 --app app-db
- throws an error
Error app-db.internal: host was not found in DNS
- I can connect to its console via
fly ssh console --app app-db
the last deploy (few days ago) was running fine.
If I remember correctly, the proxy command exposes the app on your local host (127.0.0.1:5432). Use fly wireguard to use the internal DNS.
The proxy and wireguard are two different things. Typically you would choose one or the other.
If using the proxy, you can connect using
127.0.0.1:5432, but if you have a valid Wireguard VPN connection active, you should be able to use
app-db.internal:5432 as the hostname.
I’m still suspicious something is going on with your wireguard config. What happens if you run
dig aaaa app-db.internal with wireguard on?
Thanks @fideloper-fly for the tip. What I found was trivial , the db instance doesn’t have ip allocated to it which is weird to me. So here’s what I did:
- Followed this docs in order to get one
- Restart db instance:
fly postgres restart --app app-db
When I created the app + db few months ago, db has ip address linked to it.