zeek/testing/scripts/run-dnsmasq
Arne Welzel 7eec3859fa btest/dns_mgr: Update run-dnsmasq, use --host-record
Using dnsmasq --address covers an entire domain, so dns.example.com
AAAA queries would also return IPv6 addresses for example.com

Instead, this was always meant to use host entries.
2025-03-05 12:39:15 +01:00

33 lines
915 B
Bash
Executable file

#!/usr/bin/env bash
set -eux
if ! dnsmasq --version; then
exit 1
fi
if [ $# -ne 2 ]; then
echo "Usage $0 <listen_addr> <listen_port>" >2
exit 1
fi
listen_addr=$1
listen_port=$2
exec dnsmasq \
--no-resolv \
--no-hosts \
--no-daemon \
--listen-addr="${listen_addr}" \
--port="${listen_port}" \
--host-record=example.com,10.0.0.1 \
--host-record=example.com,10.0.0.2 \
--host-record=example.com,10.0.0.3 \
--host-record=example.com,10.0.0.4 \
--host-record=example.com,fe80::6990:df6e:618:c096 \
--host-record=mx.example.com,10.0.0.99 \
--host-record=dns.example.com,10.0.0.99 \
--ptr-record=99.0.0.10.in-addr.arpa,mx.example.com \
--ptr-record=99.0.0.10.in-addr.arpa,dns.example.com \
--txt-record=example.com,network-monitor,open-source,zeek \
--txt-record=example.com,more-network-monitor,bro \
--cname=www.example.com,example.com