Adding a local DNS host entry to host OS


We are currently running a multi-container django based application on a balena raspberry pi. Everything is running nicely but we now want to be able to add a valid SSL certificate to the NGINX host on the server.

I’ve got a valid SSL certificate working fine and DNS registered to a public endpoint without a problem. So i can go to and get to the device ( as long as I’m on the same local network)

But the next bit is that these devices don’t always have internet access but the django app can still run without internet. So I’d like to have the dns public name locally resolvable for people who connect via the devices local wifi hotspot.

Is it possible to add a host file entry or modify the dnsmasq config on the balena host so that I can add a localhost/dnsmasq server entry in to match with the public name?

Both the device name and the public hostname are provided through Environment variables so it does need to be dynamic update ideally