Unable to dig _apps.internal after setting up Wireguard

I’m new to fly and was able to deploy a dockerized app and postgres. Now I’m attempting to access my postgres instance. I setup a wireguard tunnel and now cannot verify that it’s working, as outlined in the fly docs.

When I attempt to run dig _apps.internal, I get a status: NXDOMAIN in response.

I have also attempted to access my created postgres db and receive an error saying: psql: error: could not translate host name "<appname>db.internal" to address: Unknown host.

So it seems like my wireguard tunnel isn’t giving me access to the necessary resources.

I’m on a windows machine, any help would be appreciated.

Can you try dig _apps.internal @fdaa::3? Maybe there’s a DNS server overriding the one setup by WireGuard.

I’m using powershell, so I ran dig _apps.internal "@fdaa::3"

and received the following response:

; <<>> DiG 9.16.26 <<>> _apps.internal @fdaa::3
;; global options: +cmd
;; connection timed out; no servers could be reached


Using my wireguard gui. it lists the dns server as: fdaa:0:4da8::3, so I ran the following command:

dig _apps.internal "@fdaa:0:4da8::3"

and got an answer back like my first response with the following status: opcode: QUERY, status: NXDOMAIN,

I could provide the full dig output, I’m just not sure if any of it is sensitive or not. First time I’ve used it.

1 Like

Oh hmm, try this?

dig _apps.internal "@fdaa:0:4da8::3" TXT

That worked, I got back a “NOERROR” response status, and the following answer section.

_apps.internal.         5       IN      TXT     "<appname>,<appname>-db"

Which I have both an app and a db installed, so that’s what I would expect.

Do you have any idea how then to access those resources via psql? I am still receiving the following error when trying to login into psql.

psql: error: could not translate host name "<appname>-db.internal" to address: Unknown host

Does dig work for this hostname?

dig <appname>-db.internal "@fdaa:0:4da8::3" AAAA

Can you paste your, redacted, psql command?

Yes, that works and I am able to receive a response from that command.

Here is the psql command that I am using.

psql postgres://postgres:<password>@<appname>-db.internal:5432

When creating the database, I received both a Proxy Port and PG Port, I’ve tried both in the command above and receive the same response.

The fly postgres docs does show this as the command to use:

psql postgres://postgres:secret123@appname.internal:**5432**

I assume the ** around the port is a typo, I get the following error when including those asteriks.

psql: error: invalid integer value "**5432**" for connection option "port"

@Morgan if your system isn’t handling WireGuard DNS properly (it’s a bit of esoteric magic, so not too surprising), you can connect in two other ways.

You can run fly pg connect to get a psql shell.

You can also forward the server port to your local system:

fly proxy 5432 -a <appname>-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:

fly proxy 15432:5432 -a <appname>-db

Then connect to localhost:15432.

@kurt Thank you for that guidance, I was able to proxy a port and finally connect to my db via command line.

So everything is working as expected now.

Thank you and @jerome for y’alls time helping me get this setup.

1 Like