Bug #1819
DNS Forwarder Not Registering DHCP Server Specified Domain Name
| Status: | New | Start date: | 08/29/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | DNS Forwarder | |||
| Target version: | - | |||
| Affected version: | All | Affected Architecture: |
Description
DHCP Server specified Domain Name not being registered in DNS Forwarder.
Hosts are resolvable by System General specified domain name instead.
Is this expected mode of opperation? Seem like they should be registered with the domain name they are being assigned.
2.0-RC3 (i386)
built on Sun Aug 28 15:02:45 EDT 2011
History
#1
Updated by Ermal Luçi over 1 year ago
Can you please bring some examples and facts from pfSense config files?
#2
Updated by Chris Buechler over 1 year ago
- Category set to DNS Forwarder
- Target version deleted (
2.0) - Affected version changed from 2.0 to All
That's always worked that way, the domain filled in for the DHCP server if different from the primary domain name of the system is not used when registering hostnames. I believe this is a duplicate of another ticket that's been in here for a while, not readily seeing it so I'll leave this here.
#3
Updated by NOYB NOYB over 1 year ago
Could fix for the statically assigned hosts of each interface in services dhcp be as simple as this?
--- /etc/inc/system.inc 2011-08-27 21:34:19.000000000 0700 $dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n";
++ /etc/inc/system.inc.patched 2011-08-28 16:11:18.000000000 -0700@ -253,7 +253,7 @
if(is_array($dhcpifconf['staticmap']) && isset($dhcpifconf['enable']))
foreach ($dhcpifconf['staticmap'] as $host)
if ($host['ipaddr'] && $host['hostname'])
$dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$config['dhcpd'][$dhcpif]['domain']} {$host['hostname']}\n";
}
if (isset($dnsmasqcfg['dhcpfirst']))
However, the dynamically assigned hosts may be more difficult and involved due to being handled by dhcpleases process.
The following may work for just assigning the domain name of a particular services dhcp interface. Such as 'LAN'.
--- /etc/inc/system.inc 2011-08-27 21:34:19.000000000 0700 mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$config['system']['domain']} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts");
++ /etc/inc/system.inc.patched 2011-08-28 16:11:18.000000000 -0700@ -292,7 +292,7 @
if (file_exists("{$g['varrun_path']}/dhcpleases.pid"))
sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "HUP");
else
mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$config['dhcpd']['lan']['domain']} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts");
} else {
sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "TERM");
@unlink("{$g['varrun_path']}/dhcpleases.pid");
Maybe dhcpleases needs to accept a parameter list of ip address range and domain name pairs. Instead of just a statically provided domain name. Maybe provided via a config file or such...
#4
Updated by NOYB NOYB over 1 year ago
Maybe just a tad bit of logic for using system domain when not specified in dhcp interface.
--- /etc/inc/system.inc 2011-08-29 07:02:35.000000000 -0700
+++ /etc/inc/system.inc.patched 2011-08-29 18:29:46.000000000 -0700
@@ -252,8 +252,11 @@
foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf)
if(is_array($dhcpifconf['staticmap']) && isset($dhcpifconf['enable']))
foreach ($dhcpifconf['staticmap'] as $host)
- if ($host['ipaddr'] && $host['hostname'])
- $dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n";
+ if ($host['ipaddr'] && $host['hostname']) {
+ if ($config['dhcpd'][$dhcpif]['domain']) $dyndhcpifdomainname = $config['dhcpd'][$dhcpif]['domain']; // Use Services DHCP Interface Domain Name
+ else $dyndhcpifdomainname = $syscfg['domain']; // Use System General Domain Name
+ $dhosts .= "{$host['ipaddr']} {$host['hostname']}.{$dyndhcpifdomainname} {$host['hostname']}\n";
+ }
}
if (isset($dnsmasqcfg['dhcpfirst']))
@@ -291,8 +294,11 @@
@touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases");
if (file_exists("{$g['varrun_path']}/dhcpleases.pid"))
sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "HUP");
- else
- mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$config['system']['domain']} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts");
+ else {
+ if ($config['dhcpd']['lan']['domain']) $dyndhcpifdomainname = $config['dhcpd'][lan]['domain']; // Use Services DHCP 'LAN' Interface Domain Name
+ else $dyndhcpifdomainname = $config['system']['domain']; // Use System General Domain Name
+ mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$dyndhcpifdomainname} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts");
+ }
} else {
sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "TERM");
@unlink("{$g['varrun_path']}/dhcpleases.pid");
#5
Updated by NOYB NOYB over 1 year ago
- File System.DNSForwarderDHCPDomainName.FIX.patch
added
Attached patch should result in the following behavior for registering DHCP hosts in DNS Forwarder.
Statically Assigned Hosts:Services DHCP per Interface Domain Name Field
- Specified: Hosts should be registered in DNS Forwarder with Services DHCP per Interface specified Domain Name.
- Not Specified: Hosts should be registered in DNS Forwarder with System General specified Domain Name.
Services DHCP LAN Interface Domain Name Field
- Specified: Hosts should be registered in DNS Forwarder with Services DHCP LAN Interface specified Domain Name.
- Not Specified: Hosts should be registered in DNS Forwarder with System General specified Domain Name.
2.0-RC3 (i386)
built on Mon Aug 29 11:53:27 EDT 2011
#6
Updated by Chris Buechler over 1 year ago
- Target version set to 2.1
thanks. Too close to release to fix something that hasn't ever worked (probability of unintended consequences is always higher than you think), but will get it merged to mainline for 2.1.
#7
Updated by NOYB NOYB over 1 year ago
Yup, I hear ya.
Maybe by 2.1 someone could figure out how to do the dynamic hosts part per interface also, instead of just hardcoded to LAN interface.
#8
Updated by Chris Buechler about 1 year ago
- Target version deleted (
2.1)