Unable to connect to postgres with Postgrex :nxdomain

Hi, I have a fairly complicated setup here so bear with me.
Environment for context.
I’m getting a nxdomain error when attempting to connect to a postgres database.

02:52:14.727 [error] Postgrex.Protocol (#PID<0.2229.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (db-cluster-rw.default.svc.cluster.local:5432): non-existing domain - :nxdomain

The postgres database is up and working and I’m able to connect to it via psql with a separate container.

From within the same container that the phoenix app is running both ping and :inet.gethostname are able to resolve the dns.

ping -4 db-cluster-rw.default.svc.cluster.local 

Any tips on how I should proceed? If I’m missing any information that would be helpful, let me know. Thanks!

Here is also /etc/resolv.conf

search default.svc.cluster.local svc.cluster.local cluster.local us-west-2.compute.internal
options ndots:5

I ended up resolving the issue. Apparently I had some left over configuration from a fly.io deployment that was causing conflicts with dns (ipv6 perhaps) when building the release.