Ruby command line application for zone file administration on Bind DNS servers
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



named-admin is a command line tool for bind named.conf zone administration.

Reads, writes and sorts the file and finds, inserts, deletes and counts zones.

  • zones can be inserted based on customizable zone templates
  • the find action accepts wildcards (*) i.e. to find all zones of a certain domain
  • zones will be alphabetically sorted within your configuration file after each manipulation
  • option to automatically check the zone file syntax after manipulations with named-checkconf
  • option to aks for a named service restart after changes on the named configuration


Launch the main ruby script: named-admin COMMAND [argument] [options]


  • find all zones which begin with “example”: named-admin find example*
  • add a zone named “”: named-admin add
  • remove the zone “”, check the zone file but don’t ask to restart named: named-admin remove --check --no-restart

Check out named-admin --help for commands and options.


  • Download named-admin and move it to the desired application directory (i.e. /usr/local/share/named-admin)
  • Create a symlink in order to have named-admin in your execution path
    • ln -s /usr/local/share/named-admin/named-admin.rb /usr/local/sbin/named-admin
  • Copy the two configuration files from the templates and adapt them to your needs:
    • copy the base configuration file: cp config/config.yml.dist config/config.yml
    • copy the zone templates file: cp config/zones.yml.dist config/zones.yml
  • have fun and start using named-admin to simplify your daily named zone management!



  • specify the default path to you named.conf bind configuration file
  • activate automatic syntax checking with named-checkconf
  • configure whether to ask for a named restart after configuration changes

Example config.yml:

 # base configuration file for named-admin

 # specify the location of the named.conf or
 # the file which contains you named zone configurations
 named_zone_file:   '/etc/named.conf'

 # Define the command to execute in order to restart named
 # and reload the configuration
 restart_cmd:       'service named restart'
 restart_enable:    true

 # configuration of logging
 log_enable:        true
 log_file:          '/var/log/named-admin.log'

 # settings for automatically testing the configuration with named-checkconf
 checkconf_path:    '/usr/sbin/named-checkconf'
 checkconf_enable:  false


  • define different zone templates which can be used by the “add zone” action

Example zones.yml:

 # define your default zone settings
 # {{name}} is replaced by the real zone name

    type: slave
    masters: '{;; }'
    allow-query: '{ any; }'
    file: '"{{name}}.db"'

    type: master
    also-notify: '{;; }'
    allow-query: '{ none; }'
    file: '"{{name}}.db"'


Copyright © 2009 Nik Wolfgramm, released under the MIT license