I strongly suspect this issue is User caused (me). But for the life of me I haven’t been able to figure out if the solution I am using is the correct one
I have Incus hosted on an OVH vps, I have experienced the same issue in two different OCI app containers (Memos and Vikunja) where trying to connect to a third Postgresql database through DNS resolution fails with a very similar error message:
time=2026-08-11T19:15:11.173Z level=ERROR msg="Could not connect to db: dial tcp: lookup postgres.incus on [::1]:53: read udp [::1]:58328->[::1]:53: read: connection refused"
At first I thought this was an issue with the container(s), but if I try starting the container it will randomly work sometimes. I ended up with the idea that the resolv.conf file generated inside the containers sometimes does not import the correct values, so I am using the following to hardcode the correct dns namserver:
incus config set <container> oci.dns.nameservers <Incus Bridge IP>
incus restart <container>
However, sometimes this still does not work on some containers, they will still fail to access the network.
dial udp <Incus Bridge IP>:53: connect: network is unreachable
My question is, is this the correct way to set things up?, for some reason I am overthinking it and not sure if I am doing things right. This is as far as I have been able to identify a Golang issue exclusively, I have tested other types of OCI app containers, and none of them have had this issue.