Discussion:
[Dnsmasq-discuss] redundant/resiliant dnsmasq servers?
Rick Thomas
2016-03-24 19:34:02 UTC
Permalink
My home network recently suffered 5 hours of downtime because the dnsmasq server crashed and took out my DNS and DHCP service.

Is it possible to run a backup instance of dnsmasq on a different server so this wouldn't happen again?

How would I configure this?

I can (and do) have two dnsmasq/DNS servers (with identical /etc/hosts files). That works fine. But when I try to have two dnsmasq/DHCP servers (with identical /etc/ethers files) things get confused and some clients go for long periods without working network attachment.

Thanks!
Rick
Matthias Andree
2016-03-25 16:12:52 UTC
Permalink
Post by Rick Thomas
My home network recently suffered 5 hours of downtime because the dnsmasq server crashed and took out my DNS and DHCP service.
Is it possible to run a backup instance of dnsmasq on a different server so this wouldn't happen again?
Would not it be more useful to supervise and restart the service in case
of a crash? Service management is ubiquitous on the major distributions
these days... and in case the crash isn't due to memory exhaustion by
other processes, investigate why it's crashing, and have that fixed?
Kurt H Maier
2016-03-25 16:58:24 UTC
Permalink
Post by Matthias Andree
Would not it be more useful to supervise and restart the service in case
of a crash? Service management is ubiquitous on the major distributions
these days... and in case the crash isn't due to memory exhaustion by
other processes, investigate why it's crashing, and have that fixed?
Hardware fails.

khm
Weedy
2016-03-25 21:00:17 UTC
Permalink
Post by Kurt H Maier
Post by Matthias Andree
Would not it be more useful to supervise and restart the service in case
of a crash? Service management is ubiquitous on the major distributions
these days... and in case the crash isn't due to memory exhaustion by
other processes, investigate why it's crashing, and have that fixed?
Hardware fails.
Considering dhcp typically runs on the router in a home, I think hardware
failure would cause you bigger issues then "oh crap I can't even DNS"
Kurt H Maier
2016-03-25 21:34:44 UTC
Permalink
Post by Weedy
Considering dhcp typically runs on the router in a home, I think hardware
failure would cause you bigger issues then "oh crap I can't even DNS"
People use dnsmasq outside of home, as well.

khm
Matthias Andree
2016-03-26 10:06:39 UTC
Permalink
Post by Kurt H Maier
Post by Weedy
Considering dhcp typically runs on the router in a home, I think hardware
failure would cause you bigger issues then "oh crap I can't even DNS"
People use dnsmasq outside of home, as well.
Yes, but that's not the trigger for the original inquiry - it was
explicitly about a software crash:
<http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2016q1/010405.html>

Regarding failover or backups, be sure to check dhcp-authoritative. It
does not appear that dnsmasq has facilities to share its leases database
with other software. You'd probably have to cook synchronization on
your own with scripts or lua scripts.
/dev/rob0
2016-03-26 13:50:58 UTC
Permalink
Post by Matthias Andree
Regarding failover or backups, be sure to check dhcp-authoritative.
It does not appear that dnsmasq has facilities to share its leases
database with other software. You'd probably have to cook
synchronization on your own with scripts or lua scripts.
And it's probably worth noting that a major design goal of dnsmasq is
to remain simple. It targets (and nicely fills) most common needs,
and unlike many network services, you don't have to devote a lot of
time to learn how to run and manage it.

I'm sure if Simon can figure out a simple way to do failover, he
will, but I don't expect it. :)

Right now the best option for failover seems to be ISC DHCP 4.3, or
possibly Kea for the adventurous (a failover protocol does not seem
to be implemented yet, but lease database sharing is possible with
another possible point of failure: mysql or PostgreSQL.)
--
http://rob0.nodns4.us/
Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:
Kurt H Maier
2016-03-26 16:34:51 UTC
Permalink
Post by Matthias Andree
Yes, but that's not the trigger for the original inquiry - it was
<http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2016q1/010405.html>
No it wasn't. Read the message you linked. It's said the server
crashed; software or hardware failure is not specified. This is a moot
point; I'm not really sure why you're offended at the idea that someone
may want redundant services.

To the original point: it's eminently possible to run dnsmasq on a
server, have it installed on a second server, and install drbd on both
machines. You can use heartbeat or other HA tools to fire up dnsmasq on
the secondary server if the primary fails. This can be set up in a way
similar to https://help.ubuntu.com/community/HighlyAvailableNFS but with
dnsmasq as the service specified instead of nfs-kernel-server.

There are different approaches to this idea, obviously; I've had good
luck using CARP on OpenBSD to multiplex back to two dnsmasq instances
who both mounted a shared filesystem via iSCSI. Again, the trick is to
be running software like heartbeat that is capable of detecting failure
of the primary node and firing up the secondary failover service.


khm
Matthias Andree
2016-03-27 07:44:14 UTC
Permalink
Post by Kurt H Maier
Post by Matthias Andree
Yes, but that's not the trigger for the original inquiry - it was
<http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2016q1/010405.html>
No it wasn't. Read the message you linked. It's said the server
crashed; software or hardware failure is not specified. This is a moot
point; I'm not really sure why you're offended at the idea that someone
may want redundant services.
I didn't take offense - I just see that DHCP failover isn't a native
dnsmasq feature and was proposing a middle ground that does not give
full redundancy. Of course a service supervision is no good with a
hardware crash.

Please, if copying me on messages to the mailing list, do that openly as
a Cc: - thanks.

Chris Green
2016-03-26 13:03:01 UTC
Permalink
Post by Matthias Andree
Post by Kurt H Maier
Post by Matthias Andree
Would not it be more useful to supervise and restart the service in
case
Post by Kurt H Maier
Post by Matthias Andree
of a crash? Service management is ubiquitous on the major
distributions
Post by Kurt H Maier
Post by Matthias Andree
these days... and in case the crash isn't due to memory exhaustion
by
Post by Kurt H Maier
Post by Matthias Andree
other processes, investigate why it's crashing, and have that
fixed?
Post by Kurt H Maier
Hardware fails.
Considering dhcp typically runs on the router in a home, I think
hardware failure would cause you bigger issues then "oh crap I can't
even DNS"
But dnsmasq in general *doesn't* run on a dedicated router, it's
something that has been installed by a user because the DNS and DHCP
in the router is too limited.

I used to run it on my desktop machine but now run it on a dedicated
Raspberry Pi.
--
Chris Green
Weedy
2016-03-26 15:06:57 UTC
Permalink
Post by Chris Green
Post by Matthias Andree
Post by Kurt H Maier
Post by Matthias Andree
Would not it be more useful to supervise and restart the service in
case
Post by Kurt H Maier
Post by Matthias Andree
of a crash? Service management is ubiquitous on the major
distributions
Post by Kurt H Maier
Post by Matthias Andree
these days... and in case the crash isn't due to memory exhaustion
by
Post by Kurt H Maier
Post by Matthias Andree
other processes, investigate why it's crashing, and have that
fixed?
Post by Kurt H Maier
Hardware fails.
Considering dhcp typically runs on the router in a home, I think
hardware failure would cause you bigger issues then "oh crap I can't
even DNS"
But dnsmasq in general *doesn't* run on a dedicated router, it's
something that has been installed by a user because the DNS and DHCP
in the router is too limited.
Uhhhhh, like every Buffalo, d-link, Linksys, netgear, tp-link, etc router
runs dnsmasq.

And of course OpenWrt
Chris Green
2016-03-26 16:09:02 UTC
Permalink
Post by Matthias Andree
Post by Chris Green
Post by Matthias Andree
On Fri, Mar 25, 2016 at 05:12:52PM +0100, Matthias Andree
Post by Matthias Andree
Would not it be more useful to supervise and restart the
service in
Post by Chris Green
Post by Matthias Andree
case
Post by Matthias Andree
of a crash? Service management is ubiquitous on the major
distributions
Post by Matthias Andree
these days... and in case the crash isn't due to memory
exhaustion
Post by Chris Green
Post by Matthias Andree
by
Post by Matthias Andree
other processes, investigate why it's crashing, and have
that
Post by Chris Green
Post by Matthias Andree
fixed?
Hardware fails.
Considering dhcp typically runs on the router in a home, I think
hardware failure would cause you bigger issues then "oh crap I
can't
Post by Chris Green
Post by Matthias Andree
even DNS"
But dnsmasq in general *doesn't* run on a dedicated router, it's
something that has been installed by a user because the DNS and DHCP
in the router is too limited.
Uhhhhh, like every Buffalo, d-link, Linksys, netgear, tp-link, etc
router runs dnsmasq.
And of course OpenWrt
Yes, but...........

I have a router running OpenWrt but I still prefer to run dnsmasq on a
Raspberry Pi. All those routers/NAS etc. may run dnsmasq but it isn't
therefore particularly easy to configure as one wants.
--
Chris Green
Loading...