mirror of
https://github.com/GrapheneOS/infrastructure.git
synced 2025-11-24 08:43:11 -05:00
add script for checking reverse DNS
This commit is contained in:
parent
f36aa981cd
commit
ce4fe06d6a
1 changed files with 31 additions and 0 deletions
31
check-reverse-dns
Executable file
31
check-reverse-dns
Executable file
|
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. shared.sh
|
||||||
|
. hosts.sh
|
||||||
|
|
||||||
|
status=0
|
||||||
|
|
||||||
|
check_address() {
|
||||||
|
reverse=$(drill -Qx $1)
|
||||||
|
if [[ $reverse != $2. ]]; then
|
||||||
|
echo mismatched reverse dns: $reverse
|
||||||
|
status=1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
for host in ${hosts_all[@]}; do
|
||||||
|
remote=root@$host
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo $host
|
||||||
|
echo
|
||||||
|
|
||||||
|
if test -v hosts_ipv4_address[$host]; then
|
||||||
|
check_address ${hosts_ipv4_address[$host]} $host
|
||||||
|
fi
|
||||||
|
if test -v hosts_ipv6_address[$host]; then
|
||||||
|
check_address ${hosts_ipv6_address[$host]} $host
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $status
|
||||||
Loading…
Add table
Add a link
Reference in a new issue