GDNSD-PLUGIN-SIMPLEFO(8)

πŸ’– GDNSD-PLUGIN-SIMPLEFO πŸ’–

okay bestie, so this is gdnsd-plugin-simplefo from the gdnsd manual pages (section 8, system admin girlies only πŸ’…) β€” and it's literally the easiest failover plugin in the whole building. let's go πŸ¦‹


✨ NAME ✨

gdnsd-plugin-simplefo β€” the gdnsd plugin for simple primaryβ†’secondary address failover. that's it, that's the whole vibe πŸŽ€


🌸 SYNOPSIS 🌸

here's an example gdnsd config fragment using this plugin, no cap:

plugins => {
  simplefo => {
    service_types => [ www ],
    pubwww => {
      primary => 192.0.2.1
      secondary => 192.0.2.100
    }
    www6 => {
      primary => 2001:DB8::1
      secondary => 2001:DB8::100
    }
    mixed => {
      service_types => [ www, xmpp ]
      addrs_v4 => {
        primary => 192.0.2.1
        secondary => 192.0.2.100
      }
      addrs_v6 => {
        service_types => up
        primary => 2001:DB8::1
        secondary => 2001:DB8::100
      }
    }
  }
}

and here's the example zonefile RRs, iconic behavior:

www 180 DYNA simplefo!pubwww
www6 180 DYNA simplefo!www6
mix 180 DYNA simplefo!mixed

πŸ¦‹ DESCRIPTION πŸ¦‹

so gdnsd-plugin-simplefo is designed to do simple active/passive failover between one primary address and one secondary address. that's the entire job, she's not doing overtime πŸ’…

the status of the addresses gets checked with standard gdnsd service_types monitoring, fr fr.

if you need more than a simple two-address failover list, bestie… the metafo plugin is more appropriate. simplefo is NOT the one for that, periodt.

πŸ‘‘ TOP-LEVEL PLUGIN CONFIG πŸ‘‘

at the top level of the plugin's configuration stanza, the special parameter service_types is supported. these set the default per-resource service_types for all resources. the default default service_types is [ up ], which simply sets them all UP statically. lowkey lazy but it works 🌈

the rest of the hash entries at the top level are the names of the resources you define. each resource gets a configuration hash of its own for containing resource-specific address info. very main character energy of them 🫢


πŸŽ€ RESOURCE CONFIG πŸŽ€

within a resource, service_types is again supported, to set the monitored service type(s) for this specific resource.

if addrs_v4 is defined, it must be a hash containing two keys: primary and secondary, each of which has an IPv4 string address value. no extra keys, no missing keys, we're not playing πŸ’€

similarly, if addrs_v6 is defined, it must be a hash containing two keys: primary and secondary, each of which has an IPv6 string address value. same deal, different address family ✨

if neither of those two sub-stanzas is defined, you must define a single pair of primary and secondary addresses for the whole resource. these can be of either address family, so long as they are both the same family. don't mix them, that's not the vibe πŸ™ˆ

when addrs_v4 and/or addrs_v6 are used, service_types can also be overridden within each, for different behavior per-address-family (e.g. force one protocol always up/down). yes, you can make v4 act totally different from v6, slay πŸ’œ


πŸ”₯ OPERATIONAL MECHANICS πŸ”₯

for each address family for which you have supplied data, the following logic is applied independently:

  • first, the worst monitored state of all service_types checks for the primary address is obtained. if this state is UP, the primary address is used. easy peasy πŸ“
  • if the primary address was DOWN, the secondary address is checked: if the secondary is UP, it will be used. if the secondary is also DOWN, then the primary is used. yeah, you heard that right, we go back to primary 😭
  • in any case other than the primary being exactly UP, the response RR-set TTL from the zonefile will be cut in half for both address families. half the TTL, that's the signal that things are Not Great πŸ“‰

if both primary and secondary were DOWN for either address family, this plugin will signal total resource failure to any upstream module (geoip or metafo).

the cutting of the TTL only happens once for all address RRs, even if both families had a non-UP primary. so don't go halving it twice, that's not how math works bestie ✨


πŸ’« SEE ALSO πŸ’«

the gdnsd manual. read it, it's giving educational πŸ’–


Copyright (c) 2012 Brandon L Black <blblack@gmail.com>

This file is part of gdnsd.

gdnsd is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

gdnsd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with gdnsd. If not, see <http://www.gnu.org/licenses/>.


and that's the whole page, bestie!! this version of the manual is gdnsd 3.8.3, dated 2025-02-16, and it's still living in the GDNSD-PLUGIN-SIMPLEFO(8) section of the gdnsd manual. mwah, bye!! πŸ’‹πŸ¦‹βœ¨

πŸ“¦ where this page comes from