mirror of
https://github.com/lucaspalomodevelop/opnsense-core.git
synced 2026-03-13 00:07:27 +00:00
dnsmasq: When dhcp-fqdn is set, there must be a domain without an address set as default (#8405)
* dnsmasq: When dhcp-fqdn is set, there must be a domain without an address set as default
This commit is contained in:
parent
b7ed45db20
commit
b11baac9d5
@ -29,12 +29,24 @@
|
||||
namespace OPNsense\Dnsmasq\Api;
|
||||
|
||||
use OPNsense\Base\ApiMutableModelControllerBase;
|
||||
use OPNsense\Core\Config;
|
||||
|
||||
class SettingsController extends ApiMutableModelControllerBase
|
||||
{
|
||||
protected static $internalModelName = 'dnsmasq';
|
||||
protected static $internalModelClass = '\OPNsense\Dnsmasq\Dnsmasq';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
$data = parent::getAction();
|
||||
$data[self::$internalModelName]['dhcp']['this_domain'] = (string)Config::getInstance()->object()->system->domain;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/* hosts */
|
||||
public function searchHostAction()
|
||||
{
|
||||
|
||||
@ -125,6 +125,12 @@
|
||||
<type>checkbox</type>
|
||||
<help>In the default mode, we insert the unqualified names of DHCP clients into the DNS, in which case they have to be unique. Using this option the unqualified name is no longer put in the DNS, only the qualified name.</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>dnsmasq.dhcp.domain</id>
|
||||
<label>DHCP default domain</label>
|
||||
<type>text</type>
|
||||
<help>To ensure that all names have a domain part, there must be a default domain specified when dhcp-fqdn is set. Leave empty to use the system domain.</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>dnsmasq.dhcp.lease_max</id>
|
||||
<label>DHCP max leases</label>
|
||||
|
||||
@ -38,6 +38,10 @@
|
||||
<Multiple>Y</Multiple>
|
||||
</no_interface>
|
||||
<fqdn type="BooleanField"/>
|
||||
<domain type="HostnameField">
|
||||
<IsDNSName>Y</IsDNSName>
|
||||
<IpAllowed>N</IpAllowed>
|
||||
</domain>
|
||||
<lease_max type="IntegerField">
|
||||
<MinimumValue>0</MinimumValue>
|
||||
</lease_max>
|
||||
|
||||
@ -28,6 +28,14 @@
|
||||
$( document ).ready(function() {
|
||||
let data_get_map = {'frm_settings':"/api/dnsmasq/settings/get"};
|
||||
mapDataToFormUI(data_get_map).done(function(data){
|
||||
try {
|
||||
$("#dnsmasq\\.dhcp\\.domain").attr(
|
||||
"placeholder",
|
||||
data.frm_settings.dnsmasq.dhcp.this_domain
|
||||
);
|
||||
} catch (e) {
|
||||
null;
|
||||
}
|
||||
formatTokenizersUI();
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
updateServiceControlUI('dnsmasq');
|
||||
|
||||
@ -31,6 +31,7 @@ dhcp-lease-max={{dnsmasq.dhcp.lease_max}}
|
||||
|
||||
{% if dnsmasq.dhcp.fqdn == '1' %}
|
||||
dhcp-fqdn
|
||||
domain={{dnsmasq.dhcp.domain|default(system.domain)}}
|
||||
{% endif %}
|
||||
|
||||
{% if dnsmasq.dhcp.authoritative == '1' %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user