Metadata-Version: 2.1
Name: pyrevdns
Version: 1.0
Summary: PYrevDNS is a simple tool for performing reverse DNS lookups on IP addresses.
Author-email: Shivam Saraswat <thecybersapien@protonmail.com>
License: MIT License
        
        Copyright (c) 2023 Shivam Saraswat
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: repository, https://github.com/shivamsaraswat/pyrevdns
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: dnspython

# PYrevDNS

PYrevDNS is a simple tool for performing reverse DNS lookups on IP addresses. It can be used to perform a single lookup
or to perform lookups on a list of IP addresses.

## Installation Through PIP
To install dependencies, use the following command:

```bash
pip3 install -r requirements.txt
```

To import certify as module, install it using the following command:
```bash
pip3 install pyrevdns
```

## Installation with Docker
This tool can also be used with [Docker](https://www.docker.com/). To set up the Docker environment, follow these steps (trying using with sudo, if you get any error):

```bash
docker build -t pyrevdns:latest .
```

OR

Pull directly from [Docker Hub](https://hub.docker.com/r/shivamsaraswat/pyrevdns):

```bash
docker pull shivamsaraswat/pyrevdns:latest
```

## Using the PYrevDNS as command-line tool

To run the PYrevDNS on an IP address, provide the IP address with the -ip flag:

```bash
python3 pyrevdns -ip 216.58.196.110
```

For an overview of all commands use the following command:

```bash
python3 pyrevdns -h
```

The output shown below are the latest supported commands.

```bash
usage: pyrevdns [-h] [-v] [-ip IP] [-l LIST] [-d] [-t THREADS] [-r RESOLVER] [-o OUTPUT] [-silent]

PYrevDNS (Reverse DNS lookup tool)

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

INPUT:
  -ip IP                Input IP address
  -l LIST, --list LIST  Input list of IP addresses
  -d, --domain          Output only domains

CONFIGURATION:
  -t THREADS, --threads THREADS
                        Number of threads to use
  -r RESOLVER, --resolver RESOLVER
                        IP of the DNS resolver to use for lookups (default: 8.8.8.8)

OUTPUT:
  -o OUTPUT, --output OUTPUT
                        Output file
  -silent               display silent output

Example: python3 pyrevdns -ip 216.58.196.110
```

### Examples

#### Example 1:
Reverse DNS on the IP address 216.58.196.110 with the help of 1.1.1.1 DNS Resolver.

```bash
> python3 pyrevdns -ip 216.58.196.110 -r 1.1.1.1

██████╗ ██╗   ██╗██████╗ ███████╗██╗   ██╗██████╗ ███╗   ██╗███████╗
██╔══██╗╚██╗ ██╔╝██╔══██╗██╔════╝██║   ██║██╔══██╗████╗  ██║██╔════╝
██████╔╝ ╚████╔╝ ██████╔╝█████╗  ██║   ██║██║  ██║██╔██╗ ██║███████╗
██╔═══╝   ╚██╔╝  ██╔══██╗██╔══╝  ╚██╗ ██╔╝██║  ██║██║╚██╗██║╚════██║
██║        ██║   ██║  ██║███████╗ ╚████╔╝ ██████╔╝██║ ╚████║███████║
╚═╝        ╚═╝   ╚═╝  ╚═╝╚══════╝  ╚═══╝  ╚═════╝ ╚═╝  ╚═══╝╚══════╝

     Coded with Love by Shivam Saraswat (@cybersapien)

# 216.58.196.110  maa03s19-in-f110.1e100.net
```

#### Example 2:
Reverse DNS on the list of IP addresses with the help of 1.1.1.1 DNS Resolver.

```bash
> python3 pyrevdns --list test.txt -r 1.1.1.1

██████╗ ██╗   ██╗██████╗ ███████╗██╗   ██╗██████╗ ███╗   ██╗███████╗
██╔══██╗╚██╗ ██╔╝██╔══██╗██╔════╝██║   ██║██╔══██╗████╗  ██║██╔════╝
██████╔╝ ╚████╔╝ ██████╔╝█████╗  ██║   ██║██║  ██║██╔██╗ ██║███████╗
██╔═══╝   ╚██╔╝  ██╔══██╗██╔══╝  ╚██╗ ██╔╝██║  ██║██║╚██╗██║╚════██║
██║        ██║   ██║  ██║███████╗ ╚████╔╝ ██████╔╝██║ ╚████║███████║
╚═╝        ╚═╝   ╚═╝  ╚═╝╚══════╝  ╚═══╝  ╚═════╝ ╚═╝  ╚═══╝╚══════╝

     Coded with Love by Shivam Saraswat (@cybersapien)

# 216.58.196.110  maa03s19-in-f110.1e100.net
# 173.0.84.203    m.paypal.com
# 185.199.109.153 cdn-185-199-109-153.github.com
```

## Using the PYrevDNS as module

### Examples

#### Example 1

```bash
import pyrevdns

print(pyrevdns.Pyrevdns.lookup('216.58.196.110', only_domain=True))

# maa03s19-in-f110.1e100.net
```

#### Example 2

```bash
import pyrevdns

print(pyrevdns.Pyrevdns.lookup('216.58.196.110', resolver_ip='1.1.1.1'))

# 216.58.196.110  maa03s19-in-f110.1e100.net
```

## Using the Docker Container

A typical run through Docker would look as follows:

```bash
docker run -it --rm pyrevdns -ip 216.58.196.110
```
