DHCP domain search list bug and fix



  • Hi,

    I'm running pfSense 2.0.1 and found a bug in the DHCP server's domain search list with MacOS X clients. For the Mac clients to receive the correct domain search list, I need to add the following in /var/dhcpd/etc/dhcpd.conf:

    option domain-search "domain1", "domain2", "domain3";

    Assuming the list of domain search list in the DHCP server's page is a space separated list of domain names, the patch below generates the appropriate output.

    I'd appreciate if you could include this patch in the next release.

    Thanks,
    Ovidiu

    –- services.inc.orig 2012-03-23 21:09:07.000000000 -0700
    +++ services.inc 2012-03-23 21:09:40.000000000 -0700
    @@ -39,6 +39,10 @@
    pfSense_MODULE: utils
    */

    +function strify($str) {

    • return '"' . $str . '"';
      +};

    function services_dhcpd_configure() {
    global $config, $g;

    @@ -243,6 +247,8 @@

    if($dhcpifconf['domainsearchlist'] <> "") {
    $dnscfg .= " option domain-search-list "{$dhcpifconf['domainsearchlist']}";\n";

    • $domains = implode(',', array_map(strify, explode(' ', $dhcpifconf['domainsearchlist'])));
    • $dnscfg .= " option domain-search {$domains};\n";
          }

    if (isset($dhcpifconf['ddnsupdate'])) {



  • Just as a follow up, I submitted this change for review and it has been committed in github.

    https://github.com/bsdperimeter/pfsense/pull/69

    It should appear in the next release of pfSense.


Log in to reply