Need some help with custom dhcpd.conf and getting dnscache working.[DHCPD FIXED]

  • Hey guys,

    I'm trying to consolidate two FreeBSD routers into one pfSense one. I know how to/can do it in FreeBSD, but I figured I'd give pfSense a try. I'm running into two major snags, though.

    First, I can't seem to customize dhcpd.conf to my liking in the webgui.

    If I manually edit dhcpd.conf, it gets overwritten. If I chflags schg the dhcpd.conf, then the web interface breaks when trying to restart the service. Is there a way I can tell it NOT to regenerate it somehow? The config isn't going to change at all with the new setup.

    Second, I need to run dnscache on the WAN interface's alias IPs so other clients with hardcoded DNS pointed at the old servers can still resolve DNS.

    I initially tried to remedy this by just port forwarding (in pfsense) the IPs to my other dnscache servers, but the clients complained that the response was from the wrong IP. Then I installed tinydns from the webgui thinking it'd install all of djbdns. Finally, I went into the cli and just manually installed djbdns to get dnscache, and got that set up. However, it would never properly respond to dns requests to the ip aliases on the WAN they were bound to. I did confirm it was started and listening. Is there something I'm missing there? I need it to respond to clients not on any of the same subnets, if that matters at all.

    Even if I can just get #1 fixed, I'd be happy. The router ahead of the pfSense one is linux, and I can just make a simple rule to forward the dns requests elsewhere if pfSense can't do dnscache for external hosts for whatever reason.



    edit: Minor clarification.

  • So I managed to 'fix' the dhcpd. This pfsense thing is currently a side-project. I have put it on hold for a few weeks while I got caught up with some other, more pressing, work. I am surprised that no one mentioned editing the /etc/inc/ file to keep it from overwriting my custom dhcpd.conf file. What I did to 'fix' this was to edit the /etc/inc/ file, line 113 and change the filename from 'dhcpd.conf' to ''. You could comment out this line, and then the two lines around 380 that actually dump the generated config + close the filehandle, but I decided to let it auto-generate and dump to a dummy file.

    I still have not had a chance to dig into the dnscache thing more. It's such a simple utility, on my fbsd boxes I can install from ports + configure in <5 minutes. With one of the patches included I can even have one instance listening on multiple interfaces (So they share the same cache). Any pointers on that front would be great. :)

  • Yup.  The pfSense web configurator is limiting hindrance because it does not fully support many of the technologies it implements.  Such as DHCP.  Both cleint (dhclient) and server (dhcpd).

    One of the reasons I have not addopted it.  Instead use CentOS 5.6 with Webmin to configure the firewall, routing, etc.

  • I also need to modify my dhcpd.conf (need to set option 66 to different strings based on MAC address) and this was easy to do with my previous router (linux running dnsmasq) and I know that it can be done with dhcpd.conf tweaks but like the OP I don't want the file to get erased or be prevented from setting other options via the GUI.  I am surprised there isn't an add-on package to add some extra options to the gui for dhcpd.

    Meznev: could you please elaborate a little bit on how you solved this issue?

Log in to reply