VHOSTCNAME
NAMESYNOPSIS
DESCRIPTION
COMMANDS
OPTIONS
CONFIGURATION FILE
ENVIRONMENT
EXIT CODE
BUGS
SEE ALSO
AUTHOR
NAME
vhostcname - synchronize DNS with Apache virtual host configuration
SYNOPSIS
vhostcname [ OPTIONS ] COMMAND
DESCRIPTION
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:
cd /etc/init.d
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:
watcher {
path /etc/apache2/sites-available;
path /etc/apache2/sites-enabled;
event (create,delete,write);
timeout 10;
option (stderr,stdout);
command /usr/bin/vhostcname;
}
COMMANDS
start
Scan the apache configuration files and register all server names matching the supplied zones.
stop
Deregister all hostnames registered previously.
restart, force-restart, reload
Same as running vhostcname stop; vhostcname start.
status
Ignored
OPTIONS
--apache-config-directory= DIR
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.
--apache-config-pattern= GLOB
Shell globbing pattern for virtual host configuration files. By default, * is used, meaning that vhostcname will scan all files in the configuration directory.
--cname-file= NAME
Name of the file where vhostcname will keep successfully registered host names. Default is /var/run/vhostcname.cache.
-d, --debug
Increases the debug level. Multiple -d options are allowed.
-n, --dry-run,
Enables dry-run mode: print what would have been done without actually doing it.
--help
Displays vhostcname man page.
-h |
Displays a short help summary and exits. |
-H, --hostname= NAME
Sets the hostname. Use this if vhostcname is unable to correctly determine it.
--ns-key= KEYFILE
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.
--server= NAME
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= TIME
TTL value for new DNS records. Default is 3600.
--zone= NAME
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.
CONFIGURATION FILE
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:
zone =
vhost.example.com
ns-key = /etc/bind/Kvhost+157+43558.key
ttl = 3600
ENVIRONMENT
VHOSTCNAME_CONF
The name of the configuration file to use instead of the default /etc/vhostcname.conf.
EXIT CODE
0 |
Success |
|||
1 |
Operating system error (unable to open file, etc.) |
|||
2 |
Some of the host names could not be registered. |
|||
3 |
Command line usage error |
BUGS
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.
SEE ALSO
dircond(8).
AUTHOR
Sergey Poznyakoff <gray@gnu.org>
Manpage server at man.gnu.org.ua.
Powered by mansrv 1.1