Instalar rndc para manejar BIND
Mediante la utilidad rndc podemos manejar el servidor BIND, por ejemplo, pudiendo recargar únicamente una zona o forzar la transferencia de una zona sin mirar el serial. Vamos a ver cómo instalarlo:
Para la instalación de rndc deberemos añadir la configuración en el fichero rndc.conf y modificar la del named para que concuerde con ésta. Mediante el binario rndc-confgen podemos generar la configuración que deberemos añadir:
$ rndc-confgen # Start of rndc.conf key "rndckey" { algorithm hmac-md5; secret "4L1dZ0u3j1RVTTsnNEOdaA=="; }; options { default-key "rndckey"; default-server 127.0.0.1; default-port 953; }; # End of rndc.conf # Use with the following in named.conf, adjusting the allow list as needed: # key "rndckey" { # algorithm hmac-md5; # secret "4L1dZ0u3j1RVTTsnNEOdaA=="; # }; # # controls { # inet 127.0.0.1 port 953 # allow { 127.0.0.1; } keys { "rndckey"; }; # }; # End of named.conf
Por lo tanto, deberemos añadir la primera parte en el rndc.conf y la segunda (la comentada) en el named.conf. Una vez reiniciado el named ya podremos usar el comando rndc. Por ejemplo, mediante rndc reload podemos recargar la configuración del named:
# rndc reload server reload successful
Lo podemos comprobar en el log:
Sep 5 20:42:08 pica named[26929]: loading configuration from '/etc/named.conf'
También podemos recargar únicamente la zona que hemos modificado. Por ejemplo, si tenemos vistas como en el siguiente ejemplo:
view "internet" { zone "systemadmin.es" { type master; file "systemadmin.es.db"; };
Podemos indicar a named que recargue la zona con el siguiente comando:
$ rndc reload systemadmin.es in internet zone reload up-to-date
También podemos obtener el total de zonas con el comando status:
# rndc status number of zones: 2146 debug level: 0 xfers running: 0 xfers deferred: 0 soa queries in progress: 0 query logging is ON recursive clients: 0/1000 tcp clients: 0/100 server is up and running
Podemos ver todas las opciones mediante rndc sin indicar nada:
# rndc Usage: rndc [-c config] [-s server] [-p port] [-k key-file ] [-y key] [-V] command command is one of the following: reload Reload configuration file and zones. reload zone [class [view]] Reload a single zone. refresh zone [class [view]] Schedule immediate maintenance for a zone. retransfer zone [class [view]] Retransfer a single zone without checking serial number. freeze zone [class [view]] Suspend updates to a dynamic zone. thaw zone [class [view]] Enable updates to a frozen dynamic zone and reload it. reconfig Reload configuration file and new zones only. stats Write server statistics to the statistics file. querylog Toggle query logging. dumpdb [-all|-cache|-zones] [view ...] Dump cache(s) to the dump file (named_dump.db). stop Save pending updates to master files and stop the server. stop -p Save pending updates to master files and stop the server reporting process id. halt Stop the server without saving pending updates. halt -p Stop the server without saving pending updates reporting process id. trace Increment debugging level by one. trace level Change the debugging level. notrace Set debugging level to 0. flush Flushes all of the server's caches. flush [view] Flushes the server's cache for a view. flushname name [view] Flush the given name from the server's cache(s) status Display status of the server. recursing Dump the queries that are currently recursing (named.recursing) *restart Restart the server. * == not yet implemented
Deja un comentario: