Skip to content

Commit 5a617fc

Browse files
README.md
1 parent 2323035 commit 5a617fc

1 file changed

Lines changed: 35 additions & 8 deletions

File tree

README.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,30 @@
22

33
## Description
44

5-
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.**
5+
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.
6+
7+
**Note**: This module currently only supports IPv4 addresses.
8+
9+
## Table of Contents
10+
11+
- [Features](#features)
12+
- [Installation](#installation)
13+
- [Usage](#usage)
14+
- [Components](#components)
15+
- [DoHClient](#dohclient)
16+
- [Cache](#cache)
17+
- [Logging](#logging)
18+
- [Contributing](#contributing)
19+
- [License](#license)
20+
21+
## Features
22+
23+
- IPv4 Support: This module is currently limited to IPv4 addresses.
24+
- Uses Quad9 DoH Endpoint for DNS lookups.
25+
- Caches DNS lookups for faster repeated queries.
26+
- Validates IPv4 addresses.
27+
- Includes retries for failed requests.
28+
- Logs events and errors using Python's logging module.
629

730
## Installation
831

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

4265
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.
4366

44-
## Features
67+
## Classes
68+
69+
### DoHClient
70+
71+
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.
72+
73+
### Cache
74+
75+
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.
4576

46-
- **IPv4 Support**: This module is currently limited to IPv4 addresses.
47-
- Uses the Quad9 DoH Endpoint for DNS lookups
48-
- Caches DNS lookups for faster repeated queries
49-
- Validates IPv4 addresses
50-
- Includes retries for failed requests
51-
- Logs events and errors
77+
- **Eviction Based on Time**: The cache removes entries that are older than a specified duration.
78+
- **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.
5279

5380
## Contributing
5481

0 commit comments

Comments
 (0)