title: How to return "Host is not resolvable" message after gethostbyname failure
body: <p>This might be a something simple here, but I'm still learning python.
  Basically I'm trying to pull an IP address from a hostname, which works fine, but if the host does not resolve it errors. I have it now so that once it resolves the IP address it populates it to a text box, so what i'm trying to do here is if it fails to resolve... To put a message in that text box saying no host found or whatever. I get an error: "socket.gaierror: [Errno 11004] getaddrinfo failed" when it does not resolve.</p>
  
  <p>This is the code i have:</p>
  
  <pre><code>def findip():
      host = hname.get() # Pulls host from text box1
      ip = gethostbyname(host)
      ipaddress.set(ip) #exports to text box2
      return
  </code></pre>
  
  <p>So what i don't know is the If command needed for the failure (if that makes any sense) it would be something like:</p>
  
  <pre><code>if "gethostbyname fails"
      ipaddress.set("Host does not resolve")
      else
      ipaddress.set(ip)
  </code></pre>