title: How to get the Domain name in Python sockets?
body: <p>My code:   </p>
  
  <pre><code>def getHostName(ip_addr):
      host_name = socket.gethostbyaddr(ip_addr)
      if host_name != "":
            return host_name
  </code></pre>
  
  <p>When I plugin <code>216.58.220.46</code> as IP value in the above function , it returns the domain name as : <code>maa03s19-in-f14.1e100.net</code> instead of <code>google.com</code> . So what socket method should I use to get the usual Domain Name </p>