Set DNS servers after provisioning (without editing boot files)

Although you can set your own custom DNS servers on balenaCloud devices, it is only when flashing a device (or when you have physical access to said device). In many cases (including my own), this is too much trouble when you have a fleet of 50+ devices that would otherwise require physical access. Rather than having to touch each device inside your application, I offer to you a solution where you can: set custom DNS servers (for the HostOS, and subsequently all containers) on balena devices during runtime (after provisioning) . All it takes is a quick clone of this repo, setting some environment variables, and your good to go.

That’s very cool and thanks for sharing this. Last year we enabled the dnsmasq D-Bus API on the host OS and I am really glad to see such a nice example using it.

1 Like