DNSLookup
The DNSLookup module provides a simple interface for performing DNS lookups in Python. It allows you to easily retrieve the IP addresses associated with a given domain name.
Installation
To install the DNSLookup module, simply clone the repository and run the following command:
git clone https://github.com/melihteke/dnslookup-module.git
Usage
Here's an example of how to use the DNSLookup module to perform a DNS lookup:
pip install dnslookup-module
(.venv) MTeke1@APKM2W42362BA4 dnslookup-module % ipython
Python 3.8.9 (default, Apr 13 2022, 08:48:06)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from dnslookup import DNSLookup
In [2]: query = DNSLookup(domain="www.mteke.com")
In [3]: query.get_ip()
Out[3]: ['81.129.175.158']
In [4]:
API Reference
DNSLookup
The DNSLookup class represents a DNS lookup object.
Constructor
init(self, domain: str) -> None Creates a new DNSLookup object for performing DNS lookups.
Arguments
domain (str): The domain name to look up.
Methods
get_ip(self) -> List[str] Performs a DNS lookup and returns the IP address(es) associated with the domain.
Returns
list (str): A list of IP addresses associated with the domain. Raises socket.gaierror: If the DNS lookup fails.
Metadata
Release files for dnslookup-module 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dnslookup-module-1.0.0.tar.gz | 2.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dnslookup_module-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.5 kB
Release files / dnslookup-module-1.0.0.tar.gz
| Download URL | dnslookup-module-1.0.0.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8ee804aaf01f42270587c2244f925e6437587f0b69505f0f70c38c3ba68c02b
|
|
BLAKE2b-256 checksum How to use checksums |
792cc21d0d005e9787e212d8e2e23d21936bfaef413245fad3ee152951ed304e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.9
|
Release files / dnslookup_module-1.0.0-py3-none-any.whl
| Download URL | dnslookup_module-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9a95173af56ebfe4b4d3a17ad823bf0710bd7af9c77db512ef0522e884c5dc4
|
|
BLAKE2b-256 checksum How to use checksums |
3b0e91290da6874cdf467ba8290257d82eaba2f4887d1d179e1cd43ebcbb6509
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.9
|
Security for dnslookup-module 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.