Skip to content

Instantly share code, notes, and snippets.

@stevenswafford
Last active May 9, 2022 07:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stevenswafford/51e6a9f84540c607027a to your computer and use it in GitHub Desktop.
Save stevenswafford/51e6a9f84540c607027a to your computer and use it in GitHub Desktop.
Maps DNS from a given domain.
#!/usr/bin/env python
# Description : Maps DNS from a given domain.
import socket
import sys
domain = raw_input("Enter domain: ")
try:
ip = socket.gethostbyname(domain)
except socket.gaierror:
print "Invalid Domain: " + domain
sys.exit()
print "DNS: " + ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment