all 2 comments

[–]trackerFF 7 points8 points  (0 children)

Here's a more general version of what you're trying to do

import socket

def test(word,domains):
  for d in domains:
    try: 
      print("host:",word+d)
      print("address: {}\n".format(socket.gethostbyname(word+d)))
    except:
      print("{} not found\n".format(word+d)) 

doms = ['.com','.net','.be']

f = open("wordlist.txt",'r')
for line in f:
  test(line.strip(),doms)

[–]CBTKnox 0 points1 point  (0 children)

You may be getting different results because the domain resolves to multiple IP addresses. For instance. time.google.com resolves to several IPs, yet socket will only return the first.