Package: rdns-reaper
Build Statusrdns-reaper: Reverse DNS Lookup Enginerdns-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.11DocumentationRead our documentation athttps://rdns-reaper.readthedocs.io/en/latest/Object Name ChangeNote that starting with version 0.1.0, the reaper object has been renamed from rdns_reaper to RdnsReaperFor backwards compatability you can use the following import statement until your codebase is updated with the new name:>>>fromrdns_reaperimportRdnsReaperasrdns_reaperThe correct import statement for all new applications is:>>>fromrdns_reaperimportRdnsReaperInstallation and UsagePyPI$pipinstallrdns-reaper#For a specific version (e.g. 0.0.10)$pipinstallrdns-reaper==0.0.10Github with PIP#Latest Full Release$pipinstallgit+https://github.com/mullaneywt/rdns_reaper/@releases#Latest Release Candidate$pipinstallgit+https://github.com/mullaneywt/rdns_reaper/#Specific Release Version (e.g. 0.0.10)$pipinstallgit+https://github.com/mullaneywt/rdns_reaper/@0.0.10Usage>>>fromrdns_reaperimportRdnsReaper>>>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>>>foraddressinrdr:>>>print(address){('8.8.8.8','dns.google')('1.1.1.1','one.one.one.one')('8.8.4.4','dns.google')}Supported parametersThe following parameters are supported when an instance of rdns_reaper is created:parametertypedescriptiondefaultallow_reserved_networksbooleanDisables automatic filtering of IPv4/IPv6 reserved networksFalseautosavebooleanAutomatically saves disk based cache when resolve_all() is calledFalselimit_to_rfc1918booleanLimits checking to only IPv4 RFC1918 address space (IPv6 entirely disabled)FalseconcurrentintegerNumber of concurrent resolver threads to use5unresolvablestringValue to populate if resolving failsNonefilemode["r"|"w"]read only or read-write disk cacheNonefilenamestringPath and filename for YAML formatted disk cacheNonefilterIPSet, string, list of stringsSets a custom IP filterNonefiltermode["allow"|"block"]set the filter mode to an allow list or a block listNoneNote that entries with None as a value will be reprocessed in subsequent resolver runs, while entries with any other value from theunresolveableparameter will not be processed again without manual interventionSupported 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 addressesSupported magic methodscontains() - checks if a given string containing an IP address exists in the resolver instancedel() - takes a string containing an IP address and removes it from the resolver instancegetitem() - returns the resolved name for given string containing an IP addressiter() - will provider an iterator that returns address/name tupleslen() - number of unique IP addresses in a resolver instanceSupported custom methodsadd_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 networksautosave() - disable/enable automatic saving of disk based cacheclear_all_hostnames() - resets all names to None across entire instanceclearname(IP) - resets a name to Noneget_dict() - returns a dictionary with addresses as keys and names as valuesget_filter() - returns a tuple with custom filter information or None if not setget_options() - returns a dictionary listing options that have been setkeys() - returns a list of all IP addresses in the instanceloadfile() - forces a load of the YAML based disk cachelimit_to_rfc1918 - disable/enable automatic filtering to only IPv4 RFC1918 networksremove_ip(IP) - removes an IP address (provided as a string)resolve_all() - launches a threaded resolver processresolve_all_serial() - launches a singular serial resolver processsavefile() - forces a save of the YAML based disk cacheset_file(FILENAME, MODE) - sets the filename and mode ("r"|"w") for disk based cacheset_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 beblockorallowto set filtering to a block list or allow listset_name(IP, NAME) - forces the name for a value (provided as strings)values() - returns a list of all DNS namesIssues and contributingIf you find any issues, feel free to create a new issue at our github repository at:https://github.com/mullaneywt/rdns_reaper/issuesMake 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.LicenseLicensed under GNU GPL V3.0.  See the LICENSE file for more information.