vhostcname - synchronize DNS with Apache virtual host configuration
vhostcname [ OPTIONS ] COMMAND
The program takes a list of DNS zones and scans Apache virtual host configuration files. For each hostname found in ServerName and ServerAlias statements, it checks whether this name ends in a zone from the list, and if so, attempts to register this hostname using the DNS dynamic updates mechanism ( RFC 2136).
A reverse operation is also supported: deregister all host name registered on the previous run.
The mode of operation is requested by the COMMAND argument. The available COMMAND s have been chosen so as to allow vhostcname to be run as one of the machine’s startup scripts. The exact ways to register it to be run on server startup and shutdown depend on the operating system and distribution in use. For example, on Debian-based GNU/Linux:
ln -sf /usr/bin/vhostcname /etc/init.d
update-rc.d vhostcname defaults
The program can also be used as a dircond(8) handler. This use allows for immediate updates of the DNS records upon any modifications to the Apache configuration files. The following example shows the corresponding dircond.conf(5) entry:
Scan the apache configuration files and register all server names matching the supplied zones.
Deregister all hostnames registered previously.
restart, force-restart, reload
Same as running vhostcname stop; vhostcname start.
Sets the Apache configuration directory. DIR should be either a directory where virtual configuration file are located or a directory which hosts the sites-available and sites-enabled directories. In the latter case, vhostcname will look for files matching apache-config-pattern in DIR /sites-enabled.
If this option is not given, vhostcname will try to deduce where the configuration files are located. It will issue a warning message and terminate if unable to do that.
Shell globbing pattern for virtual host configuration files. By default, * is used, meaning that vhostcname will scan all files in the configuration directory.
Name of the file where vhostcname will keep successfully registered host names. Default is /var/run/vhostcname.cache.
Increases the debug level. Multiple -d options are allowed.
Enables dry-run mode: print what would have been done without actually doing it.
Displays vhostcname man page.
Displays a short help summary and exits.
-H, --hostname= NAME
Sets the hostname. Use this if vhostcname is unable to correctly determine it.
Name of the key file. The argument should be the name of a file generated by the dnssec-keygen utility. Either .key or .private file can be used.
Name of the DNS server to use. Normally vhostcname determines what server to use based on the SOA record of the zone to be updated, so this option is rarely needed.
TTL value for new DNS records. Default is 3600.
Name of the zone which vhostcname can update. Multiple --zone options can be given.
If no --zone option is given, vhostcname will take hostname as the name of the zone.
If the file etc/vhostcname.conf exists, the program will read its configuration from it. A familiar UNIX configuration format is used. Empty lines and UNIX comments are ignored. Each non-empty line is either an option name, or option assignment, i.e. opt=val, with any amount of optional whitespace around the equals sign. Valid option names are the same as the long command line options, but without the leading --. For example:
ns-key = /etc/bind/Kvhost+157+43558.key
ttl = 3600
The name of the configuration file to use instead of the default /etc/vhostcname.conf.
Operating system error (unable to open file, etc.)
Some of the host names could not be registered.
Command line usage error
Only one key file can be given. This means that if you use multiple --zone options, all zones must be configured to accept the same DNSSEC key. Ditto for the --server option.
Sergey Poznyakoff <email@example.com>
Manpage server at man.gnu.org.ua.
Powered by mansrv 1.1