require_once '/etc/inc/config.inc';global $config;$interface = "lan";$dnsfoo = "192.168.1.1";$dnsbar = "1.1.1.1";if (!is_array($config["dhcpd"])) { $config["dhcpd"] = [];}if (!is_array($config["dhcpd"][$interface])) { $config["dhcpd"][$interface] = [];}// empty the current values$config["dhcpd"][$interface]["dnsserver"] = [];// add new values to the list$config["dhcpd"][$interface]["dnsserver"][] = $dnsfoo;$config["dhcpd"][$interface]["dnsserver"][] = $dnsbar;write_config("Change DHCP globally assigned DNS");// reload services, etc here as necessary$toreturn = [ "data" => true,];