summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_dnsmasq.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-04-26 13:51:53 -0400
committerjim-p <jimp@pfsense.org>2013-04-26 13:51:53 -0400
commite6c49e3d9b54c202b7df7426461d0dbd29255c2e (patch)
tree179595408f404ae7f0003c00548bcd6b07783192 /usr/local/www/services_dnsmasq.php
parent81448ffa946974eb11aeabf31b23b674ab55954f (diff)
downloadpfsense-e6c49e3d9b54c202b7df7426461d0dbd29255c2e.zip
pfsense-e6c49e3d9b54c202b7df7426461d0dbd29255c2e.tar.gz
Add the ability to change the port on which dnsmasq listens.
Diffstat (limited to 'usr/local/www/services_dnsmasq.php')
-rwxr-xr-xusr/local/www/services_dnsmasq.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/usr/local/www/services_dnsmasq.php b/usr/local/www/services_dnsmasq.php
index 1d67b6f..55c2797 100755
--- a/usr/local/www/services_dnsmasq.php
+++ b/usr/local/www/services_dnsmasq.php
@@ -51,6 +51,7 @@ $pconfig['dhcpfirst'] = isset($config['dnsmasq']['dhcpfirst']);
$pconfig['strict_order'] = isset($config['dnsmasq']['strict_order']);
$pconfig['domain_needed'] = isset($config['dnsmasq']['domain_needed']);
$pconfig['no_private_reverse'] = isset($config['dnsmasq']['no_private_reverse']);
+$pconfig['port'] = $config['dnsmasq']['port'];
$pconfig['custom_options'] = $config['dnsmasq']['custom_options'];
if (!is_array($config['dnsmasq']['hosts']))
@@ -77,6 +78,18 @@ if ($_POST) {
$config['dnsmasq']['no_private_reverse'] = ($_POST['no_private_reverse']) ? true : false;
$config['dnsmasq']['custom_options'] = str_replace("\r\n", "\n", $_POST['custom_options']);
+ if ($_POST['port'])
+ if(is_port($_POST['port']))
+ $config['dnsmasq']['port'] = $_POST['port'];
+ else
+ $input_errors[] = gettext("You must specify a valid port number");
+ else if (isset($config['dnsmasq']['port']))
+ unset($config['dnsmasq']['port']);
+
+ if ($_POST['port'])
+ if(!is_port($_POST['port']))
+ $input_errors[] = gettext("You must specify a valid port number");
+
if ($config['dnsmasq']['custom_options']) {
$args = '';
foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c)
@@ -230,6 +243,14 @@ function show_advanced_dns() {
</td>
</tr>
<tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Listen Port");?></td>
+ <td width="78%" class="vtable"><p>
+ <input name="port" type="text" id="port" size="6" <?php if ($pconfig['port']) echo "value=\"{$pconfig['port']}\"";?>>
+ <br /><br />
+ <?=gettext("The port used for responding to DNS queries. It should normally be left blank unless another service needs to bind to TCP/UDP port 53.");?></p>
+ </td>
+ </tr>
+ <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Advanced");?></td>
<td width="78%" class="vtable"><p>
<div id="showadvbox" <?php if ($pconfig['custom_options']) echo "style='display:none'"; ?>>
OpenPOWER on IntegriCloud