function String_Begins_With($needle, $haystack)
 {
     return substr($haystack, 0, strlen($needle)) == $needle;
 }
 if (String_Begins_With(_msdcs, $_POST['domain'])) {
     $subdomainstr = substr($_POST['domain'], 7);
     if ($subdomainstr && !is_domain($subdomainstr)) {
         $input_errors[] = gettext("A valid domain must be specified after _msdcs.");
     }
 } elseif ($_POST['domain'] && !is_domain($_POST['domain'])) {
     $input_errors[] = gettext("A valid domain must be specified.");
 }
 if ($_POST['ip'] && !is_ipaddr($_POST['ip']) && $_POST['ip'] != '#' && $_POST['ip'] != '!') {
     $input_errors[] = gettext("A valid IP address must be specified, or # for an exclusion or ! to not forward at all.");
 }
 if ($_POST['dnssrcip'] && !in_array($_POST['dnssrcip'], get_configured_ip_addresses())) {
     $input_errors[] = gettext("An interface IP address must be specified for the DNS query source.");
 }
 if (!$input_errors) {
     $doment = array();
     $doment['domain'] = $_POST['domain'];
     if (empty($_POST['dnssrcip'])) {
         $doment['ip'] = $_POST['ip'];
     } else {
         $doment['ip'] = $_POST['ip'] . "@" . $_POST['dnssrcip'];
     }
     $doment['descr'] = $_POST['descr'];
     if (isset($id) && $a_domainOverrides[$id]) {
         $a_domainOverrides[$id] = $doment;
     } else {
         $a_domainOverrides[] = $doment;
        if (isset($dhcp['staticmap'])) {
            foreach ($dhcp['staticmap'] as $smap) {
                $local_hosts[$smap['ipaddr']] = strtolower("{$smap['hostname']}");
            }
        }
    }
}
// Collect Unbound Host overrides
$hosts = $config['unbound']['hosts'];
if (isset($hosts)) {
    foreach ($hosts as $host) {
        $local_hosts[$host['ip']] = strtolower("{$host['descr']}");
    }
}
// Collect configured pfSense interfaces
$pf_int = get_configured_ip_addresses();
if (isset($pf_int)) {
    $local_hosts = array_merge($local_hosts, array_flip(array_filter($pf_int)));
}
$pf_int = get_configured_ipv6_addresses();
if (isset($pf_int)) {
    $local_hosts = array_merge($local_hosts, array_flip(array_filter($pf_int)));
}
// FUNCTION DEFINITIONS
// Collect existing suppression list
function collectsuppression()
{
    global $pfb;
    $dnssupp_ex = array();
    $custom_list = pfbng_text_area_decode($pfb['dnsblconfig']['suppression']);
    if (!empty($custom_list)) {