22. Scan

22.1. Description

Runs cdist as a daemon that discover/watch on hosts and reconfigure them periodically. It is especially useful in netboot-based environment where hosts boot unconfigured, and to ensure your infrastructure stays in sync with your configuration.

This feature is still consider to be in beta stage, and only operate on IPv6 (including link-local).

22.2. Usage (Examples)

Discover hosts on local network and configure those whose name is resolved by the name mapper script.

$ cdist scan --beta --interface eth0 \
  --mode scan --name-mapper path/to/script \
  --mode trigger --mode config

List known hosts and exit.

$ cdist scan --beta --list --name-mapper path/to/script

Please refer to cdist(1) for a detailed list of parameters.

22.3. Modes

The scanner has 3 modes that can be independently toggled. If the --mode parameter is not specified, only tigger and scan are enabled (= hosts are not configured).


Send ICMPv6 requests to specific hosts or broadcast over IPv6 link-local to trigger detection by the scan module.


Watch for incoming ICMPv6 replies and optionally configure detected hosts.


Enable configuration of hosts detected by scan.

22.4. Name Mapper Script

The name mapper script takes an IPv6 address as first argument and writes the resolved name to stdout - if any. The script must be executable.

Simplest script:


case "$1" in
              printf "my-host-01"
              printf "my-host-02"

Resolving name from PTR DNS record:


for cmd in dig sed; do
      if ! command -v $cmd > /dev/null; then
              exit 1

dig +short -x "$1" | sed -e 's/.$//'