# Can't connect to my database

**URL:** <https://community.fly.io/t/cant-connect-to-my-database/4148>\
**Category:** Questions / Help\
**Tags:** postgres\
**Created:** [February 20, 2022, 3:43pm UTC](https://community.fly.io/t/cant-connect-to-my-database/4148 "2022-02-20T15:43:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jakov](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/jakov/32/6430_2.png) [@Jakov](https://community.fly.io/u/Jakov)\
**Post date:** [February 20, 2022, 3:43pm UTC](https://community.fly.io/t/cant-connect-to-my-database/4148/1 "2022-02-20T15:43:58Z")

</div>

Hi,  
I’m trying to connect to my pg database on [fly.io](http://fly.io). I create db, and on my windows pc installed wireGuard, but I still can’t connect to it. Every time i try i get anpsql: error: could

> not translate host name “eduo-db.internal” to address: Unknown hostd error saying:

Idk what to do.  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![kurt](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kurt/32/43757_2.png) [@kurt](https://community.fly.io/u/kurt)\
**Post date:** [February 20, 2022, 6:57pm UTC](https://community.fly.io/t/cant-connect-to-my-database/4148/2 "2022-02-20T18:57:49Z")

</div>

WireGuard + Windows is a little brittle with DNS, so it’s likely that it can’t figure out the IP for `eduo-db.internal`.

You can use our CLI to forward the port to your local system:

```auto
fly proxy 5432 -a eduo-db

```

Then connect to `localhost:5432` and you should be good to go. If you already have something listening on port 5432, you can run this instead:

```auto
fly proxy 15432:5432 -a eduo-db

```

Then connect to `localhost:15432`.
