On Thu, Dec 22, 2011 at 8:13 AM, Michael Rack <michael.r...@rsm-freilassing.de> wrote: > Very easy. > > You need at least one virtual ip-address for your DNS- and DHCP-Server. > > So lets say you have a Class-C Network 10.0.0.0/24 > > * Primary DNS / DHCP 10.0.0.251 > * Secondary DNS / DHCP 10.0.0.252 > > Now, you add a virtual IP to your primary DNS - lets say > > * Virtual-IP 10.0.0.250 > > From Secondary you create a Bash-Script that do the following: > > * Check the Server-Status by ping the virtual ip-address > * when the ping has failed: > * add the virtual ip-address to your network-configuration > * start dnsmasq > > To sync the DHCP-Leases to the secondary server, you need to create a > ssh-key (ssh-keygen) to copy the lease-file without knowing the ssh-passord. > > scp 10.0.0.251:/var/dhcp/dnsmasq.leases /var/dhcp/dnsmasq.leases
Please note that by default, automatic DNS registrations and the list of existing DHCP leases are going to be lost during failover. Copying the dnsmasq.leases file with cron creates a race condition as it is not synchronized with dnsmasq updating the file. I would recommend using a external database to store the leases with support for atomic updates instead of letting dnsmasq put them in /var/*/dnsmasq.leases. See the dhcp-script and leasefile-ro options. > > do this every minute via a crontab. > > So, thats it. > > > Liebe Grüße aus Freilassing, > > Michael Rack > RSM Freilassing > -- > RSM Freilassing Tel.: +49 8654 607110 > Nocksteinstr. 13 Fax.: +49 8654 670438 > D-83395 Freilassing www.rsm-freilassing.de > > > Am 22.12.2011 14:16, schrieb Markus Schöpflin: >> Hello, >> >> up to now I have been using Dnsmasq with great success in a medium sized >> setup >> as a DNS/DHCP/TFTP server in a private test bed. It currently serves a few >> hundred clients (mostly servers and networking equipment) in four different >> LANs. >> >> A few of the clients have statically configured IP addresses but most are >> using DHCP with automatic DNS registration. >> >> Now I'm faced with the need to create a fault tolerant setup for DHCP and >> DNS. >> I need at least some kind of backup service for DHCP and DNS which takes over >> automatically as soon as the primary server fails. Is this kind of setup >> supported somehow with Dnsmasq? Or should I be looking into migrating to the >> ISC DHCP server and the Bind DNS server for this? >> >> Regards, >> Markus >> >> >> _______________________________________________ >> Dnsmasq-discuss mailing list >> Dnsmasq-discuss@lists.thekelleys.org.uk >> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss > > _______________________________________________ > Dnsmasq-discuss mailing list > Dnsmasq-discuss@lists.thekelleys.org.uk > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss