title: In dnspython, given the DNS IP, how to get the DNS zone name
body: <p>Using the <code>dnspython</code> library, I have this simple code, given the DNS IP, I canquery a domain name. I need to get the zone name of the DNS server. For example, if instead of <code>8.8.8.8</code> I have a private IP <code>192.168.4.5</code> for zone named <code>com</code> and the server in question is <code>a.com</code>. </p>
  
  <p>How can I get the <code>com</code> as a result of a query for my zone's DNS IP?</p>
  
  <pre><code>import dns.resolver
  
  resolver = dns.resolver.Resolver()
  resolver.nameservers = ['8.8.8.8']
  
  def myQuery(domain, records):
      for r in records:
          try:
              response = resolver.query(domain, r)
              for rData in response:
                      domainIP = str(rData)
                      print(domainIP)
                      break # we only need one IP
          except Exception as e:
              print(e)
  
  myQuery("google.com","A")
  </code></pre>