Query nameservers to find the answer to the question. This method calls resolve() with ``search=True``, and is provided for backwards compatibility with prior versions of dnspython. See the documentation for the resolve() method for further details.
(
self,
qname: dns.name.Name | str,
rdtype: dns.rdatatype.RdataType | str = dns.rdatatype.A,
rdclass: dns.rdataclass.RdataClass | str = dns.rdataclass.IN,
tcp: bool = False,
source: str | None = None,
raise_on_no_answer: bool = True,
source_port: int = 0,
lifetime: float | None = None,
)
| 1346 | return answer |
| 1347 | |
| 1348 | def query( |
| 1349 | self, |
| 1350 | qname: dns.name.Name | str, |
| 1351 | rdtype: dns.rdatatype.RdataType | str = dns.rdatatype.A, |
| 1352 | rdclass: dns.rdataclass.RdataClass | str = dns.rdataclass.IN, |
| 1353 | tcp: bool = False, |
| 1354 | source: str | None = None, |
| 1355 | raise_on_no_answer: bool = True, |
| 1356 | source_port: int = 0, |
| 1357 | lifetime: float | None = None, |
| 1358 | ) -> Answer: # pragma: no cover |
| 1359 | """Query nameservers to find the answer to the question. |
| 1360 | |
| 1361 | This method calls resolve() with ``search=True``, and is |
| 1362 | provided for backwards compatibility with prior versions of |
| 1363 | dnspython. See the documentation for the resolve() method for |
| 1364 | further details. |
| 1365 | """ |
| 1366 | warnings.warn( |
| 1367 | "please use dns.resolver.Resolver.resolve() instead", |
| 1368 | DeprecationWarning, |
| 1369 | stacklevel=2, |
| 1370 | ) |
| 1371 | return self.resolve( |
| 1372 | qname, |
| 1373 | rdtype, |
| 1374 | rdclass, |
| 1375 | tcp, |
| 1376 | source, |
| 1377 | raise_on_no_answer, |
| 1378 | source_port, |
| 1379 | lifetime, |
| 1380 | True, |
| 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. |