Skip to content

Commit

Permalink
README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vintagecircuit authored Sep 13, 2023
1 parent 2323035 commit 5a617fc
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,30 @@

## Description

The DoHClient module in Python performs reverse DNS lookups for IPv4 addresses via DNS over HTTPS (DoH) using the Quad9 DoH endpoint. It includes caching and logging functionalities for efficiency and easier debugging. **Note: This module currently only supports IPv4 addresses.**
The DoHClient module performs reverse DNS lookups for IPv4 addresses via DNS over HTTPS (DoH) using the Quad9 DoH endpoint. It includes caching and logging functionalities for efficiency and easier debugging.

**Note**: This module currently only supports IPv4 addresses.

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Components](#components)
- [DoHClient](#dohclient)
- [Cache](#cache)
- [Logging](#logging)
- [Contributing](#contributing)
- [License](#license)

## Features

- IPv4 Support: This module is currently limited to IPv4 addresses.
- Uses Quad9 DoH Endpoint for DNS lookups.
- Caches DNS lookups for faster repeated queries.
- Validates IPv4 addresses.
- Includes retries for failed requests.
- Logs events and errors using Python's logging module.

## Installation

Expand Down Expand Up @@ -41,14 +64,18 @@ This module uses a custom logging module called `doh_logger`. Please make sure y

The caching duration is set to 5 minutes by default and can be modified by changing the `CACHE_DURATION` static variable in the `DoHClient` class.

## Features
## Classes

### DoHClient

The `DoHClient` class performs reverse DNS lookups for IPv4 addresses. It also includes a caching mechanism to minimize network requests. For more details, refer to the code documentation.

### Cache

The `Cache` class is a Least Recently Used (LRU) cache that stores DNS lookups for a specified duration. The cache supports a maximum size and automatically evicts the oldest or stale entries based on size and time.

- **IPv4 Support**: This module is currently limited to IPv4 addresses.
- Uses the Quad9 DoH Endpoint for DNS lookups
- Caches DNS lookups for faster repeated queries
- Validates IPv4 addresses
- Includes retries for failed requests
- Logs events and errors
- **Eviction Based on Time**: The cache removes entries that are older than a specified duration.
- **Eviction Based on Size**: The cache maintains its size by removing the oldest entries when a new entry is added and the cache is full.

## Contributing

Expand Down

0 comments on commit 5a617fc

Please sign in to comment.