Skip to content

Instantly share code, notes, and snippets.

@serrodcal
Last active May 5, 2026 04:36
Show Gist options
  • Select an option

  • Save serrodcal/678fcbee2050cd21ae58fb952e3d5627 to your computer and use it in GitHub Desktop.

Select an option

Save serrodcal/678fcbee2050cd21ae58fb952e3d5627 to your computer and use it in GitHub Desktop.

DNS checking

getent hosts <dns>

Connection checking without netcat

timeout 5 bash -c '</dev/tcp/<host>/<port>' && echo OK || echo KO

Note: only if bash is available.

Connection using curl

curl --connect-timeout 5 telnet://<host>:<port> && echo OK || echo KO

TLS checking

timeout 5 openssl s_client -connect <host>:<port> </dev/null 2>/dev/null \
  && echo OK || echo KO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment