Skip to content

Instantly share code, notes, and snippets.

@imaami
Created December 18, 2023 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imaami/f188ed09860bc7ef0f80e186e4c0ddbe to your computer and use it in GitHub Desktop.
Save imaami/f188ed09860bc7ef0f80e186e4c0ddbe to your computer and use it in GitHub Desktop.
Cisco Umbrella is a perfect system without flaws
#!/usr/bin/env bash
#
# Usage (_only_ if you really know what you're doing):
# etc_hosts_dig.sh >> /etc/hosts
# expand this list as needed
declare -a hosts_list=(
api.openai.com
auth0.openai.com
cdn.openai.com
chat.openai.com
openai.com
tcr9i.chat.openai.com
dl.winehq.org
jabberwock.ucw.cz
music.youtube.com
pci-ids.ucw.cz
ww1.microchip.com
xpra.org
yoctoproject.blogspot.com
youtube.com
"$@"
)
printf '# %s\n' "Generated with $(which "$0")" \
'because Cisco Umbrella is a complete shit show'
printf '%s\n' "${hosts_list[@]}" | LC_ALL=C sort -u \
| xargs -I§ bash -c 'dig @8.8.8.8 § +noall +answer \
| grep -E "[[:blank:]]IN[[:blank:]]+A[[:blank:]]" \
| head -1 | sed -E "s/^.*[[:blank:]](.+)$/\1\t§/"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment