DNS doesn't work with podman after upgrade to 22.05

After my upgrade to 22.05, I noticed that a number of my containers stopped working. After looking into, I recognized that it was only containers that had multiple services that talked to one another, for instance a web-server which has a database back-end.

I eventually traced this down to the fact that inter-service DNS was no longer functional. I thought I would mention the solution here in case it helps anyone else, as I didn’t readily find much about it online that was specific to NixOS. Anyhow, the solution turned out to be simple, and I just needed to add the DNS plugin to my configuration.nix file:

virtualisation.containers.containersConf.cniPlugins = [ pkgs.cni-plugins pkgs.dnsname-cni ];


There is an option to enable this https://search.nixos.org/options?channel=unstable&query=virtualisation.podman.defaultNetwork.dnsname