Skip to content

Instantly share code, notes, and snippets.

@zakkg3
Created March 27, 2024 17:06
Show Gist options
  • Save zakkg3/2aab8a99de11c1e210286160cb369639 to your computer and use it in GitHub Desktop.
Save zakkg3/2aab8a99de11c1e210286160cb369639 to your computer and use it in GitHub Desktop.
Dns discovery svc quering a CoreDNS
#!/bin/sh
ip=0
seg=0
while [ $seg -lt 256 ]; do
echo "$(date): Scanning 10.96.$seg.0/24..."
ip=0
while [ $ip -lt 255 ]; do
if answer=$(host 10.96.$seg $ip); then
echo $answer
fi
ip=$(expr $ip + 1)
done
seg=$(expr $seg + 1)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment