reverse-dns

domain and rDNS data not matching


When I search something on google.com, I see interaction with the following IP address: 172.217.7.132 network snapshot of google query

But when I attempt to reverse lookup the ip address, I get iad30s08-in-f132.1e100.net. and iad30s08-in-f4.1e100.net., not google.com.

What do I need to do in order to correctly identify that this IP address is resolved by google.com.

EDIT

Clarifying the question: My problem is not specific to google.com. I want to programmatically/logically arrive at google.com because that's what my browser requested for.

Same problem exists in the case of amazon: The IP address it resolves to, on reverseDNS gives me: server-13-32-167-140.sea19.r.cloudfront.net. instead of amazon.com

Code for performing reverse lookup: In [1]: def reverse_lookup(ip_address): ...: from dns import reversename, resolver ...: domain_address = reversename.from_address(ip_address) ...: return [answer.to_text() for answer in resolver.query(domain_address, "PTR")]


Solution

  • As others have mentioned, 1e100.net does, in fact, belong to google. Their reverse DNS is going to resolve to whatever they want it to resolve to, and there's not much you can do about that.

    Depending on your requirements, another alternative may be using a geolocation database to gather more information about an IP. You can find a demo of this here:

    https://www.maxmind.com/en/geoip-demo (enter your example address 172.217.7.132 in the form)

    MaxMind has various products (some free, some commercial), so one of them may fit your needs of being able to look up this info programatically.

    A different possible solution would be to get access to a WHOIS API, such as:

    https://hexillion.com/whois

    Example results:

    https://hexillion.com/samples/WhoisXML/?query=172.217.7.132&_accept=application%2Fvnd.hexillion.whois-v2%2Bjson