NAME

    gdnsd - An authoritative DNS daemon

SYNOPSIS

      Usage: gdnsd [-c /etc/gdnsd/config ] action
        -c Use a non-default config file path
      Actions:
        checkconf - Checks validity of configuration and zonefiles
        startfg - Start gdnsd in foreground mode with logging to stderr
        start - Start gdnsd as a regular daemon
        stop - Stops a running daemon previously started by 'start'
        restart - Effectively equivalent to checkconf && stop && start, but faster
        reload - Aliases 'restart'
        force-reload - Aliases 'restart'
        condrestart - Does 'restart' action only if already running
        try-restart - Aliases 'condrestart'
        status - Checks the status of the running daemon
        lpe_on - Turns on log_packet_errors in the running daemon
        lpe_off - Turns off log_packet_errors in the running daemon

DESCRIPTION

    gdnsd is very fast, light, and pluggable authoritative DNS daemon.

    The only commandline flag is "-c", which allows specifying an alternate
    configuration file from the compiled-in default.

ACTIONS

    gdnsd acts as its own initscript, internalizing daemon management
    functions. All valid invocations of the gdnsd command include an action,
    most of which model normal initscript actions.

    checkconf
        Checks the validity of the configuration file and any referenced
        zonefiles, setting the exit status appropriately (0 for success).

        All other actions implicitly do the first half of the "checkconf"
        work (checking the configfile itself) as they load the configuration
        file anyways (at a minimum, they usually need pidfile information
        from it). The "start", "startfg", and "restart" actions implicitly
        do a full "checkconf", since they actually load the zone data for
        runtime use.

    startfg
        Starts gdnsd in foreground mode, with all of the logging that would
        normally go to syslog appearing instead on stderr. Useful for
        debugging and testing.

    start
        Starts gdnsd as a regular background daemon.

    stop
        Stops the gdnsd daemon previously started by start.

    restart
        This is equivalent to the sequence "checkconf && stop && start", but
        faster. What actually happens behind the scenes is a bit more
        complicated:

        "restart" is a special case of "start" which first does all of the
        "checkconf" actions (bringing all the runtime data into memory),
        then stops the existing daemon, and then finishes starting itself
        (acquiring sockets, dropping privs, spawning threads, etc).

        The net result is that this minimizes the pause in service
        availability during the restart (especially if you have a large
        volume of zone data that takes significant time to load), and also
        leaves the original daemon instance untouched if the configuration
        is invalid (you've made an error in your new zone data, etc).

    reload
        Alias for "restart". gdnsd does not have any other way to reload
        configuration, and it's a fairly seamless restart in any case.

    force-reload
        Again, an aliase for "restart".

    condrestart
        This is basically "restart only if already running".

        Performs the same actions as "restart", but aborts early (with a
        successful exit value) if the daemon was not already running.

    try-restart
        Alias for "condrestart".

    status
        Checks the status of the running daemon, returning 0 if it is
        running or non-zero if it isn't

    lpe_on
        Turns on log_packet_errors in the running daemon by sending it the
        "SIGUSR1" signal.

        This causes additional syslog messages to be issued for
        per-DNS-request errors, as well as similar pre-request error logging
        for the stats HTTP server, etc. Normally such errors are only
        tracked in stats counters, as it would be easy to spam someone's
        syslog files by sending malformed packets while log_packet_errors is
        in effect. Mostly useful for debugging issues with specific queries
        and or zone data sets. One shouldn't leave this on all the time in
        production.

    lpe_off
        Turns off log_packet_errors in the running daemon by sending it the
        "SIGUSR2" signal.

    Any other commandline option will be treated as invalid, which will
    result in displaying a short help text to STDERR and exiting with a
    non-zero exit status. This includes things like the ubiquitous --help
    and --version.

ENVIRONMENT VARIABLES

    TZ  On most systems tested, gdnsd's current solution for getting syslog
        timestamps correct while under "chroot()" seems to work fine, as it
        does "tzset()" before "chroot()", and so no special setting of the
        "TZ" environment variable is required.

        On some older/stranger systems, the syslog messages will revert to
        UTC timestamps after "chroot()". The workaround for these systems is
        to either set the "TZ" environment variable in gdnsd's initscript to
        a value like "/etc/localtime", which will make glibc cache the
        timezone correctly, or to copy all of the relevant timezone files
        into the chroot directory (/etc/localtime and perhaps all of
        /usr/share/zoneinfo). Or whatever your platform may require. Patches
        welcome.

SIGNALS

    Any signal not explicitly mentioned is not explicitly handled. That is
    to say, they will have their default actions, which often include
    aborting execution.

    SIGTERM, SIGINT
        Causes the daemon to exit gracefully with accompanying log output.

    SIGUSR1
        Enables the logging of packet errors.

    SIGUSR2
        Disables the logging of packet errors.

    SIGHUP, SIGPIPE
        Ignored when daemonized.

EXIT STATUS

    An exit status of zero indicates success, anything else indicates
    failure.

SEE ALSO

    gdnsd.config(5), gdnsd.zonefile(5)

    The gdnsd manual.

COPYRIGHT AND LICENSE

    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/>.

