diff --git a/src/usr/local/www/vpn_openvpn_csc.php b/src/usr/local/www/vpn_openvpn_csc.php
index 35b4298e9e..11af827c27 100644
--- a/src/usr/local/www/vpn_openvpn_csc.php
+++ b/src/usr/local/www/vpn_openvpn_csc.php
@@ -239,6 +239,13 @@ if ($_POST['save']) {
 		}
 	}
 
+	if ($pconfig['dns_domain_enable']) {
+		if (!empty($pconfig['dns_domain']) &&
+		    !is_hostname($pconfig['dns_domain'])) {
+			$input_errors[] = gettext("DNS Default Domain must contain a valid DNS host or domain name");
+		}
+	}
+
 	if ($pconfig['dns_server_enable']) {
 		if (!empty($pconfig['dns_server1']) && !is_ipaddr(trim($pconfig['dns_server1']))) {
 			$input_errors[] = gettext("The field 'DNS Server #1' must contain a valid IP address");
@@ -291,6 +298,10 @@ if ($_POST['save']) {
 		    !array_key_exists($pconfig['netbios_ntype'], $netbios_nodetypes)) {
 			$input_errors[] = gettext("The selected NetBIOS Node Type is not valid.");
 		}
+		if (!empty($pconfig['netbios_scope']) &&
+		    !is_hostname($pconfig['netbios_scope'])) {
+			$input_errors[] = gettext("NetBIOS Scope ID must contain a valid DNS host or domain name");
+		}
 	}
 
 	$reqdfields[] = 'common_name';
diff --git a/src/usr/local/www/vpn_openvpn_server.php b/src/usr/local/www/vpn_openvpn_server.php
index 2305e1e2e9..4dfc346f9f 100644
--- a/src/usr/local/www/vpn_openvpn_server.php
+++ b/src/usr/local/www/vpn_openvpn_server.php
@@ -513,6 +513,13 @@ if ($_POST['save']) {
 		}
 	}
 
+	if ($pconfig['dns_domain_enable']) {
+		if (!empty($pconfig['dns_domain']) &&
+		    !is_hostname($pconfig['dns_domain'])) {
+			$input_errors[] = gettext("DNS Default Domain must contain a valid DNS host or domain name");
+		}
+	}
+
 	if ($pconfig['dns_server_enable']) {
 		if (!empty($pconfig['dns_server1']) && !is_ipaddr(trim($pconfig['dns_server1']))) {
 			$input_errors[] = gettext("The field 'DNS Server #1' must contain a valid IPv4 or IPv6 address");
@@ -565,6 +572,10 @@ if ($_POST['save']) {
 		    !array_key_exists($pconfig['netbios_ntype'], $netbios_nodetypes)) {
 			$input_errors[] = gettext("The selected NetBIOS Node Type is not valid.");
 		}
+		if (!empty($pconfig['netbios_scope']) &&
+		    !is_hostname($pconfig['netbios_scope'])) {
+			$input_errors[] = gettext("NetBIOS Scope ID must contain a valid DNS host or domain name");
+		}
 	}
 
 	if ($pconfig['maxclients'] && !is_numericint($pconfig['maxclients'])) {
diff --git a/src/usr/local/www/wizards/openvpn_wizard.inc b/src/usr/local/www/wizards/openvpn_wizard.inc
index d1faa6e641..767b3c1424 100644
--- a/src/usr/local/www/wizards/openvpn_wizard.inc
+++ b/src/usr/local/www/wizards/openvpn_wizard.inc
@@ -412,6 +412,11 @@ function step10_submitphpaction() {
 			!strstr($_POST['tlssharedkey'], "-----END OpenVPN Static key V1-----"))
 			$input_errors[] = "The field 'TLS Authentication Key' does not appear to be valid";
 
+	if (!empty($_POST['defaultdomain']) &&
+		!is_hostname($_POST['defaultdomain'])) {
+		$input_errors[] = "DNS Default Domain must contain a valid DNS host or domain name";
+	}
+
 	if (!empty($_POST['dnsserver1']) && !is_ipaddr(trim($_POST['dnsserver1'])))
 		$input_errors[] = "The field 'DNS Server #1' must contain a valid IP address";
 	if (!empty($_POST['dnsserver2']) && !is_ipaddr(trim($_POST['dnsserver2'])))
@@ -426,6 +431,11 @@ function step10_submitphpaction() {
 	if (!empty($_POST['ntpserver2']) && !is_ipaddr(trim($_POST['ntpserver2'])))
 		$input_errors[] = "The field 'NTP Server #2' must contain a valid IP address";
 
+	if (!empty($_POST['nbtscope']) &&
+		!is_hostname($_POST['nbtscope'])) {
+		$input_errors[] = "NetBIOS Scope ID must contain a valid DNS host or domain name";
+	}
+
 	if (!empty($_POST['winsserver1']) && !is_ipaddr(trim($_POST['winsserver1'])))
 		$input_errors[] = "The field 'WINS Server #1' must contain a valid IP address";
 	if (!empty($_POST['winsserver2']) && !is_ipaddr(trim($_POST['winsserver2'])))
@@ -433,14 +443,13 @@ function step10_submitphpaction() {
 
 	if ($_POST['concurrentcon'] && !is_numeric($_POST['concurrentcon']))
 		$input_errors[] = "The field 'Concurrent connections' must be numeric.";
-	
+
 	if ($_POST['connuserlimit'] && !is_numeric($_POST['connuserlimit']))
 		$input_errors[] = "The field 'Duplicate Connection Limit' must be numeric.";
 
 	if (empty($_POST['tunnelnet']))
 		$input_errors[] = "A 'Tunnel network' must be specified.";
 
-
 	if (count($input_errors) > 0) {
 		$savemsg = $input_errors[0];
 		$stepid = $stepid - 1;
