Oidentd /
Cron
TheLion contributed this helpful conjob for generating ident in lieu of identfile
# Pastebin KBjosn4R
#!/bin/sh
# znc-gen-oidentd.sh -- generate a static .oidentd.conf for the znc user.
# Maps each ZNC user's BindHost (IPv6) to their username so oidentd can
# answer ident queries per-user without the ZNC identfile module.
# Replaces the serialized identfile mechanism; see znc.conf backups 2026-07-08.
# Run as root (cron daily + after adding users with a new vhost).
CONF=/home/znc/home/znc/.znc/configs/znc.conf
OUT=/home/znc/home/znc/.oidentd.conf
TMP=$(mktemp -d /tmp/genoidentd.XXXXXX) || exit 1
trap 'rm -rf "$TMP"' EXIT
# user-level and network-level BindHosts
awk '
/^<User /{u=$2; gsub(/>/,"",u)}
/^\tBindHost = /{print u, $3}
/^\t\tBindHost = /{print u, $3}
' "$CONF" | sort -u > "$TMP/binds"
# resolve to IPv6 literals (BindHost may already be a literal)
while read -r user host; do
case "$host" in
*:*) echo "$host $user" ;;
*.*) for ip in $(dig +short +time=3 +tries=2 AAAA "$host" 2>/dev/null | grep :); do
echo "$ip $user"
done ;;
esac
done < "$TMP/binds" | sort -u > "$TMP/map"
# drop any IP claimed by more than one user (ambiguous)
awk '{c[$1]++; line[$1]=$0} END{for (i in c) if (c[i]==1) print line[i]}' "$TMP/map" | sort -k2 > "$TMP/uniq"
n=$(wc -l < "$TMP/uniq")
if [ "$n" -lt 10 ]; then
echo "znc-gen-oidentd: only $n mappings resolved; refusing to install" >&2
exit 1
fi
{
echo "# Generated by $0 -- DO NOT EDIT (regenerated from znc.conf BindHosts)"
echo 'global { reply "znc" }'
while read -r ip user; do
printf 'from %s { reply "%s" }\n' "$ip" "$user"
done < "$TMP/uniq"
} > "$OUT.new"
chown znc:znc "$OUT.new" && chmod 644 "$OUT.new" && mv "$OUT.new" "$OUT"
