Skip to content

Instantly share code, notes, and snippets.

@cfg
Created May 30, 2019 19:37
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 cfg/3a3c3e1180a6789ba612eddd93fa9cff to your computer and use it in GitHub Desktop.
Save cfg/3a3c3e1180a6789ba612eddd93fa9cff to your computer and use it in GitHub Desktop.
Use python for quick dns lookups when other tools (dig, host, nslookup) aren't available
import socket
list( map( lambda x: x[4][0], socket.getaddrinfo('example.com.', 80, 0, socket.SOCK_STREAM) ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment