Supported parameters in subnets.cfg?

devilkin

Well-Known Member
May 11, 2020
33
4
48
Hi,

I was wondering which parameters are supported in subnets.cfg?
I'd like to pass the search domain using DHCP, but I can't find out which parameter would correctly translate to dnsmasq.
 
I don't think that search domain is already send in dhcp options.
(the code is /usr/share/perl5/PVE/Network/SDN/Dhcp/Dnsmasq.pm)

But it should be defined at zone level (you have a dns suffix option). they are no dhcp options configurable in subnets.cfg currently.
 
I came looking for the same. Currently the VMs attached to my Simple dhcpsnat zone do not receive a default search domain from dnsmasq. I would like to supply something like "lab01" or "internal" etc. Is it possible?

Seems like we should be able to hand-edit the config files at e.g. /etc/dnsmasq.d/dhcpnat/10-vnet0.conf but I am not sure what the exact syntax would be. I have tried e.g.

Code:
dhcp-range=set:dhcpnat-10.0.0.0-24,10.0.0.0,static,255.255.255.0,infinite
dhcp-option=tag:dhcpnat-10.0.0.0-24,option:router,10.0.0.1
interface=vnet0
domain=lab01
dhcp-option=tag:dhcpnat-10.0.0.0-24,option:domain-name,lab01
dhcp-option-force=tag:dhcpnat-10.0.0.0-24,option:domain-search,lab01

But it doesn't seem to work, yet...

1750341292989.png
 
Last edited:
Ah actually it does work, I just was editing the files on the wrong node..... doh!

This is all that is needed (I saved it as /etc/dnsmasq.d/dhcpnat/searchdomain.conf on all nodes...)

Code:
dhcp-option=tag:dhcpnat-10.0.0.0-24,option:domain-name,lab01
dhcp-option=tag:dhcpnat-10.0.0.0-24,option:domain-search,lab01

After, reboot the node, or just bounce dnsmasq...
Code:
systemctl restart dnsmasq@dhcpnat

1750398557979.png

Would be wonderful to have knobs in the VNet GUI to configure this instead of having to manually set and deal with replicating it across the cluster...
 
  • Like
Reactions: fba and _gabriel