rdns-reaper


Namerdns-reaper JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryReverse DNS lookup engine
upload_time2023-06-02 23:16:45
maintainer
docs_urlNone
author
requires_python>=3.7
licenseGNU GPL v3.0
keywords dns reverse
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rdns-reaper)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/rdns-reaper)
![PyPI](https://img.shields.io/pypi/v/rdns-reaper)
![piwheels](https://img.shields.io/piwheels/v/rdns-reaper)
![LGTM Grade](https://img.shields.io/lgtm/grade/python/github/mullaneywt/rdns_reaper)

Build Status

![Read the Docs](https://img.shields.io/readthedocs/rdns_reaper)
![](https://github.com/mullaneywt/rdns_reaper/actions/workflows/releases_build.yaml/badge.svg)
![](https://github.com/mullaneywt/rdns_reaper/actions/workflows/main_build.yaml/badge.svg)
![](https://github.com/mullaneywt/rdns_reaper/actions/workflows/dev_build.yaml/badge.svg)

rdns-reaper: Reverse DNS Lookup Engine
======================================

rdns-reaper is a multi-threaded lookup engine for Python v3 to resolve DNS names from IP addresses.  IP addresses can be added to the custom class by a calling program individually or in batches, after which point the client triggers the resolver to execute on all IP addresses.  Once the lookup completes, the calling program can retrieve the data in a variety of ways.

The library currently runs on IPv4 addresses and IPv6 address.  Entries can be cached to disk to prevent excessive querying.  Limited filtering exists to restrict lookups to RFC1918 IPv4 space as an option.

rdns-reaper is currently tested with Python 3.6-3.11

Documentation
-------------

Read our documentation at https://rdns-reaper.readthedocs.io/en/latest/

Object Name Change
------------------

**Note that starting with version 0.1.0, the reaper object has been renamed from rdns_reaper to RdnsReaper**

For backwards compatability you can use the following import statement until your codebase is updated with the new name:

```python
>>> from rdns_reaper import RdnsReaper as rdns_reaper
```

The correct import statement for all new applications is:

```python
>>> from rdns_reaper import RdnsReaper
```


Installation and Usage
----------------------


### PyPI
```shell
$ pip install rdns-reaper

#For a specific version (e.g. 0.0.10)
$ pip install rdns-reaper==0.0.10
```

### Github with PIP
```shell
#Latest Full Release
$ pip install git+https://github.com/mullaneywt/rdns_reaper/@releases

#Latest Release Candidate
$ pip install git+https://github.com/mullaneywt/rdns_reaper/

#Specific Release Version (e.g. 0.0.10)
$ pip install git+https://github.com/mullaneywt/rdns_reaper/@0.0.10
```

### Usage
```python
>>> from rdns_reaper import RdnsReaper
>>> rdr = RdnsReaper(limit_to_rfc1918=False, concurrent=20, unresolvable=r"N\A")

>>> iplist = ["8.8.8.8", "1.1.1.1", "8.8.4.4"]
>>> rdr.add_ip_list(iplist)
>>> rdr.resolve_all()

>>> rdr["1.1.1.1"]
one.one.one.one

>>> for address in rdr:
>>>   print(address)
{
	('8.8.8.8', 'dns.google')
	('1.1.1.1', 'one.one.one.one')
	('8.8.4.4', 'dns.google')
}
```

### Supported parameters
The following parameters are supported when an instance of rdns_reaper is created:
|parameter|type|description|default|
|-|-|-|-|
| allow_reserved_networks | boolean | Disables automatic filtering of IPv4/IPv6 reserved networks | False |
| autosave | boolean | Automatically saves disk based cache when resolve_all() is called | False |
| limit_to_rfc1918 | boolean | Limits checking to only IPv4 RFC1918 address space (IPv6 entirely disabled) | False |
| concurrent | integer | Number of concurrent resolver threads to use | 5 |
| unresolvable | string | Value to populate if resolving fails | None |
| filemode | ["r"\|"w"] | read only or read-write disk cache | None |
| filename | string | Path and filename for YAML formatted disk cache | None |
| filter | IPSet, string, list of strings | Sets a custom IP filter | None |
| filtermode | ["allow"\|"block"] | set the filter mode to an allow list or a block list | None |

Note that entries with None as a value will be reprocessed in subsequent resolver runs, while entries with any other value from the `unresolveable` parameter will not be processed again without manual intervention

### Supported operators
* \+, which can add two rdns_reaper objects, a string with a single IP address, or a set/list with one or more IP addresses
* \+=, which can add two rdns_reaper objects, a string with a single IP address, or a set/list with one or more IP addresses

### Supported magic methods
* contains() - checks if a given string containing an IP address exists in the resolver instance
* del() - takes a string containing an IP address and removes it from the resolver instance
* getitem() - returns the resolved name for given string containing an IP address
* iter() - will provider an iterator that returns address/name tuples
* len() - number of unique IP addresses in a resolver instance

### Supported custom methods
* add_ip(IP) - adds an IP address (provided as a string)
* add_ip_list(IP_LIST) - adds IP addresses (provided as a list of strings)
* allow_reserved_networks() - disable/enable automatic filter of reserved networks
* autosave() - disable/enable automatic saving of disk based cache
* clear_all_hostnames() - resets all names to None across entire instance
* clearname(IP) - resets a name to None
* get_dict() - returns a dictionary with addresses as keys and names as values
* get_filter() - returns a tuple with custom filter information or None if not set
* get_options() - returns a dictionary listing options that have been set
* keys() - returns a list of all IP addresses in the instance
* loadfile() - forces a load of the YAML based disk cache
* limit_to_rfc1918 - disable/enable automatic filtering to only IPv4 RFC1918 networks
* remove_ip(IP) - removes an IP address (provided as a string)
* resolve_all() - launches a threaded resolver process
* resolve_all_serial() - launches a singular serial resolver process
* savefile() - forces a save of the YAML based disk cache
* set_file(FILENAME, MODE) - sets the filename and mode ("r"|"w") for disk based cache
* set_filter(IPSet, [mode=]) - sets a custom filter based on an IPSet, IP network in a string, or a list of strings containing IP networks.  Optional mode argument can be `block` or `allow` to set filtering to a block list or allow list
* set_name(IP, NAME) - forces the name for a value (provided as strings)
* values() - returns a list of all DNS names

Issues and contributing
-----------------------

If you find any issues, feel free to create a new issue at our github repository at: https://github.com/mullaneywt/rdns_reaper/issues

Make sure you include information about the version you're running, the environment you're running in, what data you've presented to the lookup engine, and what your responses/error information was.

Feature requests can also be created as an issue on github at the repository above.

For Python developers, if you have a new feature or a bug-fix that you've implemented, please open a pull request with some detailed information about what you intend to add or fix.

If you still having questions, feel free to email the maintainer.

License
-------

Licensed under GNU GPL V3.0.  See the LICENSE file for more information.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "rdns-reaper",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "dns,reverse",
    "author": "",
    "author_email": "Will Mullaney <rdns-reaper@mullaneywt.anonaddy.com>",
    "download_url": "https://files.pythonhosted.org/packages/81/6c/7eb51c3ea392be43055ef7b15edd7a2b963b27f108a49123b8bae07998de/rdns_reaper-0.1.1.tar.gz",
    "platform": null,
    "description": "[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rdns-reaper)\n![PyPI - Wheel](https://img.shields.io/pypi/wheel/rdns-reaper)\n![PyPI](https://img.shields.io/pypi/v/rdns-reaper)\n![piwheels](https://img.shields.io/piwheels/v/rdns-reaper)\n![LGTM Grade](https://img.shields.io/lgtm/grade/python/github/mullaneywt/rdns_reaper)\n\nBuild Status\n\n![Read the Docs](https://img.shields.io/readthedocs/rdns_reaper)\n![](https://github.com/mullaneywt/rdns_reaper/actions/workflows/releases_build.yaml/badge.svg)\n![](https://github.com/mullaneywt/rdns_reaper/actions/workflows/main_build.yaml/badge.svg)\n![](https://github.com/mullaneywt/rdns_reaper/actions/workflows/dev_build.yaml/badge.svg)\n\nrdns-reaper: Reverse DNS Lookup Engine\n======================================\n\nrdns-reaper is a multi-threaded lookup engine for Python v3 to resolve DNS names from IP addresses.  IP addresses can be added to the custom class by a calling program individually or in batches, after which point the client triggers the resolver to execute on all IP addresses.  Once the lookup completes, the calling program can retrieve the data in a variety of ways.\n\nThe library currently runs on IPv4 addresses and IPv6 address.  Entries can be cached to disk to prevent excessive querying.  Limited filtering exists to restrict lookups to RFC1918 IPv4 space as an option.\n\nrdns-reaper is currently tested with Python 3.6-3.11\n\nDocumentation\n-------------\n\nRead our documentation at https://rdns-reaper.readthedocs.io/en/latest/\n\nObject Name Change\n------------------\n\n**Note that starting with version 0.1.0, the reaper object has been renamed from rdns_reaper to RdnsReaper**\n\nFor backwards compatability you can use the following import statement until your codebase is updated with the new name:\n\n```python\n>>> from rdns_reaper import RdnsReaper as rdns_reaper\n```\n\nThe correct import statement for all new applications is:\n\n```python\n>>> from rdns_reaper import RdnsReaper\n```\n\n\nInstallation and Usage\n----------------------\n\n\n### PyPI\n```shell\n$ pip install rdns-reaper\n\n#For a specific version (e.g. 0.0.10)\n$ pip install rdns-reaper==0.0.10\n```\n\n### Github with PIP\n```shell\n#Latest Full Release\n$ pip install git+https://github.com/mullaneywt/rdns_reaper/@releases\n\n#Latest Release Candidate\n$ pip install git+https://github.com/mullaneywt/rdns_reaper/\n\n#Specific Release Version (e.g. 0.0.10)\n$ pip install git+https://github.com/mullaneywt/rdns_reaper/@0.0.10\n```\n\n### Usage\n```python\n>>> from rdns_reaper import RdnsReaper\n>>> rdr = RdnsReaper(limit_to_rfc1918=False, concurrent=20, unresolvable=r\"N\\A\")\n\n>>> iplist = [\"8.8.8.8\", \"1.1.1.1\", \"8.8.4.4\"]\n>>> rdr.add_ip_list(iplist)\n>>> rdr.resolve_all()\n\n>>> rdr[\"1.1.1.1\"]\none.one.one.one\n\n>>> for address in rdr:\n>>>   print(address)\n{\n\t('8.8.8.8', 'dns.google')\n\t('1.1.1.1', 'one.one.one.one')\n\t('8.8.4.4', 'dns.google')\n}\n```\n\n### Supported parameters\nThe following parameters are supported when an instance of rdns_reaper is created:\n|parameter|type|description|default|\n|-|-|-|-|\n| allow_reserved_networks | boolean | Disables automatic filtering of IPv4/IPv6 reserved networks | False |\n| autosave | boolean | Automatically saves disk based cache when resolve_all() is called | False |\n| limit_to_rfc1918 | boolean | Limits checking to only IPv4 RFC1918 address space (IPv6 entirely disabled) | False |\n| concurrent | integer | Number of concurrent resolver threads to use | 5 |\n| unresolvable | string | Value to populate if resolving fails | None |\n| filemode | [\"r\"\\|\"w\"] | read only or read-write disk cache | None |\n| filename | string | Path and filename for YAML formatted disk cache | None |\n| filter | IPSet, string, list of strings | Sets a custom IP filter | None |\n| filtermode | [\"allow\"\\|\"block\"] | set the filter mode to an allow list or a block list | None |\n\nNote that entries with None as a value will be reprocessed in subsequent resolver runs, while entries with any other value from the `unresolveable` parameter will not be processed again without manual intervention\n\n### Supported operators\n* \\+, which can add two rdns_reaper objects, a string with a single IP address, or a set/list with one or more IP addresses\n* \\+=, which can add two rdns_reaper objects, a string with a single IP address, or a set/list with one or more IP addresses\n\n### Supported magic methods\n* contains() - checks if a given string containing an IP address exists in the resolver instance\n* del() - takes a string containing an IP address and removes it from the resolver instance\n* getitem() - returns the resolved name for given string containing an IP address\n* iter() - will provider an iterator that returns address/name tuples\n* len() - number of unique IP addresses in a resolver instance\n\n### Supported custom methods\n* add_ip(IP) - adds an IP address (provided as a string)\n* add_ip_list(IP_LIST) - adds IP addresses (provided as a list of strings)\n* allow_reserved_networks() - disable/enable automatic filter of reserved networks\n* autosave() - disable/enable automatic saving of disk based cache\n* clear_all_hostnames() - resets all names to None across entire instance\n* clearname(IP) - resets a name to None\n* get_dict() - returns a dictionary with addresses as keys and names as values\n* get_filter() - returns a tuple with custom filter information or None if not set\n* get_options() - returns a dictionary listing options that have been set\n* keys() - returns a list of all IP addresses in the instance\n* loadfile() - forces a load of the YAML based disk cache\n* limit_to_rfc1918 - disable/enable automatic filtering to only IPv4 RFC1918 networks\n* remove_ip(IP) - removes an IP address (provided as a string)\n* resolve_all() - launches a threaded resolver process\n* resolve_all_serial() - launches a singular serial resolver process\n* savefile() - forces a save of the YAML based disk cache\n* set_file(FILENAME, MODE) - sets the filename and mode (\"r\"|\"w\") for disk based cache\n* set_filter(IPSet, [mode=]) - sets a custom filter based on an IPSet, IP network in a string, or a list of strings containing IP networks.  Optional mode argument can be `block` or `allow` to set filtering to a block list or allow list\n* set_name(IP, NAME) - forces the name for a value (provided as strings)\n* values() - returns a list of all DNS names\n\nIssues and contributing\n-----------------------\n\nIf you find any issues, feel free to create a new issue at our github repository at: https://github.com/mullaneywt/rdns_reaper/issues\n\nMake sure you include information about the version you're running, the environment you're running in, what data you've presented to the lookup engine, and what your responses/error information was.\n\nFeature requests can also be created as an issue on github at the repository above.\n\nFor Python developers, if you have a new feature or a bug-fix that you've implemented, please open a pull request with some detailed information about what you intend to add or fix.\n\nIf you still having questions, feel free to email the maintainer.\n\nLicense\n-------\n\nLicensed under GNU GPL V3.0.  See the LICENSE file for more information.\n",
    "bugtrack_url": null,
    "license": "GNU GPL v3.0",
    "summary": "Reverse DNS lookup engine",
    "version": "0.1.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/mullaneywt/rdns_reaper/issues",
        "Documentation": "https://rdns-reaper.readthedocs.io",
        "Home Page": "https://github.com/mullaneywt/rdns_reaper",
        "Source": "https://github.com/mullaneywt/rdns_reaper"
    },
    "split_keywords": [
        "dns",
        "reverse"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7c840e8a0b1bf81a98f2d9e1e86865f7aa5c3c176cfbf3bdd3d0b17a304a893b",
                "md5": "fe749d11ffe65a33fec9158eb8941853",
                "sha256": "c1013f144316d73ca642fbb3d4a11565c880482355cbabbfdbf9b008d5a916da"
            },
            "downloads": -1,
            "filename": "rdns_reaper-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe749d11ffe65a33fec9158eb8941853",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 21224,
            "upload_time": "2023-06-02T23:16:42",
            "upload_time_iso_8601": "2023-06-02T23:16:42.945949Z",
            "url": "https://files.pythonhosted.org/packages/7c/84/0e8a0b1bf81a98f2d9e1e86865f7aa5c3c176cfbf3bdd3d0b17a304a893b/rdns_reaper-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "816c7eb51c3ea392be43055ef7b15edd7a2b963b27f108a49123b8bae07998de",
                "md5": "45980b4b3a32478a67c0c39e4129685d",
                "sha256": "a910d9e606a595fba81a00ab2a22753bfe18e086d32339431091dc8601a4ab17"
            },
            "downloads": -1,
            "filename": "rdns_reaper-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "45980b4b3a32478a67c0c39e4129685d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 22925,
            "upload_time": "2023-06-02T23:16:45",
            "upload_time_iso_8601": "2023-06-02T23:16:45.166147Z",
            "url": "https://files.pythonhosted.org/packages/81/6c/7eb51c3ea392be43055ef7b15edd7a2b963b27f108a49123b8bae07998de/rdns_reaper-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-02 23:16:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mullaneywt",
    "github_project": "rdns_reaper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "rdns-reaper"
}
        
Elapsed time: 0.07117s