Use a resolver to run a reverse query for PTR records. This utilizes the resolve() method to perform a PTR lookup on the specified IP address. *ipaddr*, a ``str``, the IPv4 or IPv6 address you want to get the PTR record for. All other arguments that can be
(self, ipaddr: str, *args: Any, **kwargs: Any)
| 1381 | ) |
| 1382 | |
| 1383 | def resolve_address(self, ipaddr: str, *args: Any, **kwargs: Any) -> Answer: |
| 1384 | """Use a resolver to run a reverse query for PTR records. |
| 1385 | |
| 1386 | This utilizes the resolve() method to perform a PTR lookup on the |
| 1387 | specified IP address. |
| 1388 | |
| 1389 | *ipaddr*, a ``str``, the IPv4 or IPv6 address you want to get |
| 1390 | the PTR record for. |
| 1391 | |
| 1392 | All other arguments that can be passed to the resolve() function |
| 1393 | except for rdtype and rdclass are also supported by this |
| 1394 | function. |
| 1395 | """ |
| 1396 | # We make a modified kwargs for type checking happiness, as otherwise |
| 1397 | # we get a legit warning about possibly having rdtype and rdclass |
| 1398 | # in the kwargs more than once. |
| 1399 | modified_kwargs: Dict[str, Any] = {} |
| 1400 | modified_kwargs.update(kwargs) |
| 1401 | modified_kwargs["rdtype"] = dns.rdatatype.PTR |
| 1402 | modified_kwargs["rdclass"] = dns.rdataclass.IN |
| 1403 | return self.resolve( |
| 1404 | dns.reversename.from_address(ipaddr), *args, **modified_kwargs |
| 1405 | ) |
| 1406 | |
| 1407 | def resolve_name( |
| 1408 | self, |