GDNSD.CONFIG(5) gdnsd GDNSD.CONFIG(5) (NAME) gdnsd.config - gdnsd (SYNOPSIS) options => { tcp_timeout => 15 ; zonefile-style comment listen => [ 127.0.0.1, 192.0.2.1 ] } # shell-style comment service_types => { foosvc => { plugin => http_status, vhost => www.example.com, url_path => "/checkme" } barsvc => $include{bar-svc.cfg} $include{other-services.cfg} } plugins => { null => {} } (DESCRIPTION) gdnsd . config . /etc/gdnsd "-c" . . (ordered hashes) . (Double-quote) . gdnsd : options service_types plugins. (Hash) . . . (OPTIONS HASH) gdnsd(8) . zones_default_ttl 86400. (time- to-live TTL) (zonefile) . $TTL ( gdnsd.zonefile(5) ). max_ttl 3600000 ( ) 3600 268435455 (2^28-1 ). TTL . TTL (clamped) . TTL A . . min_ttl 5 0 86400 ( ). TTL . TTL TTL DYN[AC] TTL (ncache) SOA. max_ttl . max_ncache_ttl 10800 10 86400. TTL SOA . . min_ttl . dns_port . DNS . listen listen DNS . IP ( ) ( getaddrinfo() ) . "dns_port" 53 . IPv6 . listen . : options => { listen = 192.0.2.1 } : options => { listen = [ 192.0.2.1, 192.0.2.2, 2001:DB8::1, "[2001:DB8::1234]:53035", ] } : options => { listen => { 192.0.2.1 => { tcp_timeout = 15 }, 192.0.2.2:53035 => { udp_threads = 5 }, } } ( ) "tcp_threads" "tcp_timeout" "tcp_clients_per_thread" "tcp_fastopen" "udp_threads" "udp_rcvbuf" "udp_sndbuf". "any" : options => { listen => any } "dns_port" ( ) "ANY" IPv4 IPv6 0.0.0.0 "::" . "ANY" gdnsd . "listen" . "any" . tcp_threads . TCP DNS . ( CPU) . udp_threads "tcp_threads" UDP DNS. tcp_clients_per_thread . tcp DNS gdnsd tcp . . "tcp.close_s_kill" . ( / ) BSD "SO_ACCEPTFILTER" ("accf_dataready" / "accf_dns") ( ). ( "SO_REUSEPORT" ) "tcp_clients_per_thread * tcp_threads" . tcp_timeout . TCP RFC 7828 EDNS TCP Keepalive RFC 8490 DNS Stateful Operations (DSO) . gdnsd ( ) . ( ). ( TCP_DEFER_ACCEPT ) BSD dnsready dataready . ( ). TCP ( / ) . / . edns TCP keepalive ( EDNS TCP DSO ). . DSO Keepalive TLV DSO KeepAlive DSO (Infinite) . DSO . disable_tcp_dso false. DNS RFC 8490 (DSO) TCP . / (RFC 7828 EDNS TCP Keepalive) . tcp_backlog . "backlog" listen() TCP . "TCP_DEFER_ACCEPT" "SO_ACCEPTFILTER" . "SOMAXCONN" . tcp_fastopen . TCP Fastopen . TCP Fastopen ( DNS ) SYN . / anycast TFO . tcp_proxy false. TCP "listen" . PROXY UDP UDP . PROXY TCPv4 TCPv6 LOCAL PROXYv2 . IP PROXY gdnsd GeoIP edns-client-subnet . PROXY TCP . PROXY localhost . gdnsd . PROXY TCP : tcp.proxy: count of received connections on PROXY listeners (also increments the normal tcp.conns stat). tcp.proxy_fail: count of received PROXY connections which are closed early for failing to send a PROXY header the server parses and likes (also increments tcp.close_s_err) : options => { listen => { 0.0.0.0 => { ... } # normal UDP+TCP on port 53 :: => { ... } # normal UDP+TCP on port 53 for IPv6 127.0.0.1:53035 => { tcp_proxy => true, ... } } } tcp_pad false TCP true "tcp_proxy" ( ). TCP "listen" . EDNS OPT RR EDNS Padding RFC 8467 (pad) . TCP . udp_rcvbuf . "SO_RCVBUF" UDP . udp_sndbuf . "SO_SNDBUF" UDP . tcp_control - TCP . . . TCP ( ) . listen . . "chal_ok" "ctl_ok" false . TCP ("gdnsdctl status" "gdnsdctl stats" "gdnsdctl states"). "chal_ok" ACME Challenge ("gdnsdctl acme-dns-01" "gdnsdctl acme-dns-01-flush"). "ctl_ok" ("gdnsdctl reload-zones" "gdnsdctl replace"). "gdnsdctl stop" TCP . TCP . : options => { tcp_control => 127.0.0.1:885 } # read-only ops only options => { tcp_control => [ 127.0.0.1:885, 127.0.0.2:885 ] } # ditto options => { tcp_control => { 127.0.0.1:885 => {} # readonly 127.0.0.1:886 => { chal_ok => true } # allows challenge stuff 127.0.0.1:887 => { ctl_ok => true } # allows daemon control 127.0.0.1:888 => { chal_ok => true, ctl_ok => true } # allows both }} "gdnsdctl" "-s" TCP "tcp_control" . zones_strict_data "false". false () . true . zones_rfc1035_threads . RFC1035 ( ) . : N ( ) . . . I/O ( SSD) ! lock_mem false. mlockall(MCL_CURRENT|MCL_FUTURE) RAM swap . swap DNS . ulimit ( infinity) . disable_text_autosplit false. "TXT" . RFC (concatenated). "TXT" . gdnsd . true "TXT" . max_edns_response . edns UDP IPv4 edns . . RR (fragmentation) MTU ( ) . . max_edns_response_v6 . edns UDP IPv6. . edns_client_subnet true. edns-client-subnet RFC 7871 . gdnsd EDNS . (scope mask) . EDNS client-subnet . false gdnsd edns-client-subnet . "reflect" "geoip" edns-client-subnet . . chaos_response "gdnsd". gdnsd "CH" ("Chaos") "IN" ("Internet") "CH" "TXT" . BIND "version.bind" "CH" . acme_challenge_ttl . ACME DNS-01 "gdnsdctl acme-dns-01 ..." TXT . gdnsdctl(8) "acme-dns-01" . acme_challenge_dns_ttl . ACME DNS-01 "gdnsdctl acme-dns-01 ..." TTL TXT . DNS TTL TTL "acme_challenge_ttl" . ACME . "_acme-challenge" TTL TTL TTL . nsid . ASCII . EDNS NSID (RFC 5001) . NSID EDNS . anycast . nsid_ascii ASCII. "nsid" NSID ASCII . "nsid" "nsid_ascii" . experimental_no_chain true. true () "CNAME" "CNAME" . ( ) . ( ) . ( !) false CNAME . : RFC 7871 (edns-client-subnet) . (minimal responses) DNSSEC . . 2020: ( ) ( ) . disable_cookies false. EDNS RFC 7873 . (amplification attacks) . gdnsd anycast gdnsd . . max_nocookie_response () . UDP EDNS . (truncate) TC TCP . . . cookie_key_file . EDNS . . . . . RNG : "dd if=/dev/urandom of=cookie.key bs=32 count=1". . . "cookie_key_file" anycast . . //run/gdnsd/cookie.autokey . . Linux/systemd run . run_dir //run/gdnsd. . . . . . state_dir //lib/gdnsd. . . . . admin_state . (SERVICE_TYPES) service_types gdnsd . . service_types . "up" "down" "UP" "DOWN" . "up" . service_type (anti- flap) . . "plugins" . "UP" "DOWN" . "UP" "DOWN" . gdnsd HTTP ( 3506) . service_types : up_thresh . "DOWN" "UP" . ok_thresh . . down_thresh . "ok_thresh" "down_thresh" "UP" "DOWN" . "UP" . "UP" . . "down_thresh" "DOWN" . "ok_thresh" . "UP" ( ) "DOWN" . "DOWN" "UP" . interval . . timeout interval/2 . . "interval" "interval" . plugin . . . gdnsd service_types . ( "gdnsd-plugin-FOO"): tcp_connect TCP . CNAME. http_status HTTP URL vhost HTTP . CNAME. extmon . CNAME . extfile . CNAME . static . CNAME . null (always-down) . CNAME . (PLUGINS) plugins . . "{}" . . . gdnsd ( "man gdnsd-plugin-FOO"): reflect IP DNS / edns- client-subnet . simplefo (failover) / . multifo (all-active failover) . weighted CNAME. metafo << >> . CNAME . geoip metafo MaxMind GeoIP . CNAME . null CNAME "invalid." - . static IP CNAME - . service_types : service_types => { corpwww_type => { plugin => http_status vhost => www.corp.example.com url_path => /check_me down_thresh => 5 interval => 5 } } plugins => { null => {}, reflect => {}, static => { foo = 192.0.2.2 bar = 192.0.2.123 somehost = somehost.example.net. }, multifo => { web-lb => service_types => [ corpwww_type, xmpp ], lb01 => 192.0.2.200, lb02 => 192.0.2.201, lb03 => 192.0.2.202, } } } example.com : zeros 600 DYNA null reflect 10 DYNA reflect reflect-both 10 DYNA reflect!both pointless 42 DYNA static!foo acname 400 DYNC static!somehost www 300/45 DYNA multifo!web-lb (LOW-LEVEL SYNTAX) gdnsd ( ) . : ( ) . . . ("#") DNS (";") . . ("{" "}"). "=>" "=" ( ). . . / . ("[" "]"). . . ( ) . (""") ( /utf-8 NUL) """ "\" . "\" "\"" "\\". . : "][}{;#,"=\" ( ). ("$") . RFC . "\" . "\" (0 9) . "\" ( 255 ). : example "example" ex\097mpl\e "ex\097mpl\e" internal\"doublequote "internal\"doublequote" white\ space "white space" "braces{every[where]oh}my" braces\{every\[where\]oh\}my "\\===" "\092===" "\092\=\=\=" \\\=\=\= \092\=\=\= . gdnsd (include) ( ). . . << >> ( ) . . <<>> "true" "false" . : ( ): options = { listen = [ 192.0.2.1, 192.0.2.2 ], } ( ): "options" => { listen => [ 192.0.2.1 192.0.2.2 ] } ( ): options={listen=[192.0.2.1 192.0.2.2]} (INCLUDING OTHER FILES) vscf (includefiles) . : $include{dir/file} # single file must exist $include{dir/*} # not ok if no matching files $include{dir} # ok if no files in dir / . . $include "{" . ( / ) . . (glob) . - . "/*" . vscf ( ) . include : (Value Context) include ( ) . (flattening) ( ). ( ) . : main config: options => { listen => $include{foo} } foo: [ 127.0.0.1, 127.0.0.2 ] main config: plugins => $include{ "bar" } bar: geoip => { ... } extmon => { ... } (Hash-Merge Context) include . ( ) . (shallow) . : main config: options => { ... }, plugins => { extmon => { ... }, $include{geoip.cfg}, $include{plugins.d}, } geoip.cfg: geoip => { ... } plugins.d/foo: weighted => { ... } simplefo => { ... } plugins.d/bar: metafo => { ... } plugins.d/baz: null => { ... } (SEE ALSO) gdnsd(8), gdnsd.zonefile(5), gdnsd-plugin-simplefo(8), gdnsd-plugin-multifo(8), gdnsd-plugin-weighted(8), gdnsd-plugin-metafo(8), gdnsd-plugin-geoip(8), gdnsd-plugin-extmon(8), gdnsd-plugin-extfile(8) gdnsd. (COPYRIGHT AND LICENSE) (c) 2012 Brandon L Black gdnsd . gdnsd : (GNU GPL) ( ) / . gdnsd . . gdnsd . . gdnsd 3.8.3 2026-04-04 GDNSD.CONFIG(5)