Add entry to domains cfg in uci


is there an easy way to add an entry to domain without running grep on the config?
initially I tried using this:

set dhcp.@domain[-1]=domain
set dhcp.@domain[-1].name='${HOSTNAME}'
set dhcp.@domain[-1].ip='${ASSIGNED_IP}'

which just overwrote the last entry. I'm looking for an append behavior.



You can edit the relevant UCI file: /etc/config/dhcp

Append the following:

config domain
	option name 'foo.lan'
	option ip ''

In particular, look at add and add_list