It's really great letting DNSMasq take care of DHCP / DNS, as it "just knows" everything... as it should, considering it dished out the addresses to the hosts...

However, it seems (to me) - impossible to separate the "routing logic" from the DHCP portion of the program for most SoHo routers..

For example -

  1. A location's router cannot run DNSMasq.
  2. The LAN is served by a single IP / connection with NAT routing handled by WAN gateway router...
  3. Internal DNS and DNS forwarding is provided by an Internal host, possibly with ports 53 forwarded to it, etc.

  4. I've been too sure it would't work to ever try, but can you hand off the DHCP addressing responsibilities to the internal DNSMasq server (on a private IP), while still allowing a dedicated hardware router to serve as the external gateway..?

It seems like the address allocation is inextricably connected to the address allocation process, but that just seems so primitive..... Would a router be able to figure out the port-mapping and create the routing tables, if it had not allocated the addresses itself, possibly ARPing the whole thing as it goes along, or something?


Here's a quicky: If you can change the starting options of the dnsmasq daemon it supports what you're asking for: for disabling internal DNS caching -p 0 will facilitate that setting the dhcp option 6 (DNS server) and option 3 for the outbound gateway.

I would suggest looking at DHCP3-server on a cheap box, but that's just me. If this is what you've got the below should do the trick.

dnsmasq -p 0 --dhcp-option = 6,[ipofdnsserver] --dhcp-option=3,[ipofgateway]

(fyi dnsmasq man page: http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html)

  • Right... But will that be enough for the router to perform it's port mapping functions, etc... Traditionally, the Router has been performing those forwards based on static private allocations in it's own configuration... How can those same forwards be specified if the router isn't handling that address space's reservations? Would it be able to handle the dynamic port translation, but not static, possibly? DNS is not the issue, it's the routing / forwarding that seems iffy. – mralexgray Jun 11 '11 at 18:08
  • If the head end is performing it's job with static nat to an inline soho then you'll need to define a dynamic nat rule to get your traffic out. If you're performing PAT down to some devices in your DMZ (or heaven forbid into your network proper) then you've gotta figure out how to define those. Ultimately what gravyface is getting at is, all of ^^that stuff has nothing to do with DNSmasq. If your soho box is running DNSmasq it's probably using iptables -nat MASQ rules to facilitate your natting. – Ori Jun 11 '11 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.