Wireguard connection down?

I was able to connect to my postgres database via wireguard yesterday but can’t seem to today. I can connect via my wireguard interface but dig -t txt _apps.internal doesn’t show any apps. Not sure if something is down or I did something wrong. Thanks.

DNS can get weird with Wireguard. Will you grab the DNS server address from your wireguard config, then run dig txt _apps.internal @<ip>?

You can also try running fly dig txt _apps.internal -a <appname> to see if that’s working.

Thanks for the response. Both of those commands work (which is great) but I can’t run psql <database_url> and connect to my database. Do I need to run something before psql? Here’s the error i get:

psql: error: could not translate host name "copter-db.internal" to address: Name or service not known

What OS is this? On MacOS I sometimes need to open a new shell after wireguard is established to get it to do .internal DNS properly.

You can workaround DNS with the proxy command:

  • Run fly proxy 15432:5432 -a copter-db
  • Connect to localhost:15432 with psql

If your postgres version is recent, you can also run fly pg connect -a copter-db to get psql.

1 Like

I’m running Ubuntu 20.04. I’m a wireguard noob so I’ll spend more time on it and see if there’s something weird on my end. I did run into an issue when creating the wireguard because the name of a connection is limited to 15 characters on Linux. I got it to work but had to manually set the parameters when running fly wireguard create.

The DNS workaround and the pg connect both worked great! Thanks for the help.

1 Like