Suggested upgrade path away from ISC DHCP to DNSmasq without breaking anything ?

Started by rfox, Today at 10:06:59 AM

Previous topic - Next topic
As originally asked in this post: https://forum.opnsense.org/index.php?topic=53448.0

I have been running OPNSense for quite some time - using Unbound, ZenArmor and an external Pi-Hole together in the chain - and I know that ISC DHCP is deprecated - but I've been putting it off to convert my home lab to dnsmasq out of fear I might break my dns chain somehow . . .

Per the suggestion from Nero355 - I'm opening this topic as a discussion basis - to help novices like myself understand the best practice in migrating away from ISC DCHP to dnsmasq.  Ideally, there would be some sort of migration script offered during an upgrade, or at least a write up explaining the steps would be welcome.

Thanks and Happy Thanksgiving to all!

I'm in the same situation as you, using Unbound, ZenArmor and and 2 external Pi-Holes together in the chain. I am a self taught noob and my setup using ISC just runs perfect. Ive tried setting up KEA/Dnsmasq and I've broken my setup every time. So I will be following this thread closely.

We have our own documentation here (which is a bit more generic and not entirely migration from ISC specific):

https://docs.opnsense.org/manual/dnsmasq.html
https://docs.opnsense.org/manual/kea.html

But there's also community documentation with screenshots etc here (which is more ISC specific):

https://homenetworkguy.com/how-to/migrate-from-isc-dhcp-to-dnsmasq-or-kea-dhcp-in-opnsense/
Hardware:
DEC740

Quote from: rfox on <strong>Today</strong> at 10:06:59 AMPer the suggestion from Nero355 - I'm opening this topic as a discussion basis - to help novices like myself understand the best practice in migrating away from ISC DCHP to dnsmasq.
Quote from: jauger on <strong>Today</strong> at 03:12:16 PMI'm in the same situation as you, using Unbound, ZenArmor and and 2 external Pi-Holes together in the chain.

I am a self taught noob and my setup using ISC just runs perfect.
Ive tried setting up KEA/Dnsmasq and I've broken my setup every time.

So I will be following this thread closely.
The first step is to ask yourself what your DNS configuration looks like at this point ?!

After that you can migrate everything step by step :)

QuoteIdeally, there would be some sort of migration script offered during an upgrade
There is no official script, but there have been some attempts by a couple of users to create such a thing, however I think you don't need anything like that at all.
Quoteor at least a write up explaining the steps would be welcome.
This guide :
Quote from: Monviech (Cedrik) on <strong>Today</strong> at 03:42:34 PMBut there's also community documentation with screenshots etc here (which is more ISC specific):

https://homenetworkguy.com/how-to/migrate-from-isc-dhcp-to-dnsmasq-or-kea-dhcp-in-opnsense/
Is seriously good IMHO and I have read it at the time to see if I had missed something or not because I was pretty new to OPNsense and had a bit of a non-standard configuration running without using Unbound at all : My Pi-Hole + Unbound setup does that for me :)

Currently it's like this :
- KEA does DHCP.
- There are about 50 Static DHCP IP Address Mappings based on the MAC Address.
- All of these have Local DNS Records in Pi-Hole.
- The DNS Server IP Address for each Network/VLAN configured in KEA is the IP Address of Pi-Hole in that specific VLAN.
(My Pi-Hole has multiple VLAN Interfaces configured.)

So the DNS flow can be :
- Clients => Local DNS Record Query => Pi-Hole
- Clients => External DNS Record Query => Pi-Hole => Unbound => DNS Root Servers


For additional TIPS & HINTS here are some old posts from topics when migrating away from ISC was a thing :

Migrating can be done really quickly :
QuoteI moved from ISC to KEA in about 10 minutes :
- Export all Static DHCP Mappings into seperate .csv files via the webGUI feature.
- Setup everything in KEA but DO NOT Enable it yet!
- Go to your ISC DHCP networks and Stop & Disable all of them one by one.
- Enable KEA for all those Networks/Interfaces and Start the service if needed.

DONE! :)
&
Quote- Export all Static DHCP Mappings from ISC DHCP Server for all Interfaces/Networks.
- Pre-configure KEA DHCP Server and Import the Static DHCP Mappings for each Interface/Network.

Now that it's just a matter of :
- Stopping & Disabling ISC DHCP Server on all your Interfaces.
- Enabling and Starting KEA DHCP Server on all your Interfaces.

ISC vs. DNSmasq when it comes to Local Domain Host Queries :
Quote- ISC DHCP talking to Unbound for DNS Registration of Hostnames.

- DNSmasqd does the DNS Registration of Hostnames but all the Clients talk directly to Unbound so you need to tell Unbound about the existence of the DNSmasqd Hostnames DNS Registration Database/Cache.
&
QuoteClients => DNS Query to Local Gateway IP => Query goes to Unbound @ Port 53 => DNS Records are requested directly from the Root DNS Servers.

This is a problem when you are using DNSmasqd that also does DNS :

Clients => Request for DHCP IP Address => Query goes to DNSmasqd which runs on the Local Gateway IP => DNSmasqd sends the available DHCP IP Address to the Client and registers it's Hostname in it's DNS Database/Cache.

But...

Unbound doesn't know the Hostname of the Client unless you make sure it queries DNSmasqd @ Port 53053 Locally.

Keep this in mind :
Quote- The reservations used in DNSMasqd can be both inside and outside your DHCP Range !!
ISC and KEA like those to be OUTSIDE your DHCP range.

And this is a very recent and nice summarized post/topic about KEA and DNSmasq : https://forum.opnsense.org/index.php?topic=53140.msg275696#msg275696
That is also posted in the HowTo sub-forum : https://forum.opnsense.org/index.php?topic=53150.0



Good luck! :)
Weird guy who likes everything Linux and *BSD on PC/Laptop/Tablet/Mobile and funny little ARM based boards :)