How to setup local DNS?

I am using an AppVM(sys-proxy) to add networking between two qubes (A and B). For sys-proxy, I am using debian 12 minimal template, with nftables to facilitate networking. I would like to use dnsmasq to assign local domain names so qube B can be accessed by a name like gentoolab.local

What would be the most straightforward way to accomplish this?

1 Like

The simplest method is just to add an entry in /etc/hosts , but it does not scale well.

It will be easy if:

  • all qubes use the same template and you are ok to add the entry in the template
  • a couple of qubes need the entry

Setup

For the sake of examples, I assume gentoolab.local IP is 10.137.0.1.

Template level

In a template, edit /etc/hosts and add a line like this:

10.137.0.1 gentoolab.local

Then, any qubes using that template will be able to use gentoolab.local.

AppVM level

Edit /rw/config/rc.local and add this line:

echo "10.137.0.1 gentoolab.local" >> /etc/hosts

This will add the host entry at each boot.