Skip to content

Commit

Permalink
docs: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
single9 committed Jul 11, 2024
1 parent bbb19fd commit 99e0a83
Showing 1 changed file with 71 additions and 2 deletions.
73 changes: 71 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
# dns-geolocation-checker
# DNS Geolocation Checker

## Settings
This project is a Rust application designed to check the geolocation of DNS addresses. It utilizes various Rust crates to parse configuration files, perform DNS queries, and check IP geolocations.

## Getting Started

To get started with this project, clone the repository and ensure you have Rust and Cargo installed on your system.

### Installation

1. Clone the repository:

```sh
git clone https://github.com/single9/dns-geolocation-checker.git
```

2. Navigate to the project directory:

```sh
cd dns-geolocation-checker
```

3. Build the project:

```sh
cargo build
```

## Usage

### Configuration

You can configure the DNS Geolocation Checker by modifying the `config.toml` file. The configuration file contains the following sections:

```toml
[test_subnets]
Expand All @@ -11,3 +41,42 @@ us = { subnets = ["44.208.193.0/24"] }
host = "www.example.com"
geo_routing = ["sg", "us"]
```

The default configuration file contains two sections: `test_subnets` and `domain`. The `test_subnets` section contains a list of subnets that are used to test the geolocation of IP addresses. The `domain` section contains a list of domains to check, along with the geolocation routing for each domain.

Put the file `config.toml` in the `configs` directory of the project. Or you can specify the path to the configuration file using the `CONFIG_PATH` environment variable when running the application.

```sh

### Run

To run the DNS Geolocation Checker, use the following command:

```sh
cargo run
```

When you run the DNS Geolocation Checker, it will query the DNS records for each domain and check the geolocation of the IP addresses returned. If the IP address falls within one of the subnets specified in the `test_subnets` section, the geolocation will be considered a match.

### Build

To build the project, use the following command:

```sh
cargo build
```

You can find the compiled binary in the `target/release` directory.

## Running the tests

To run the tests for this project, execute:

```sh
cargo test --verbose
```

## TODO

- [ ] CLI mode
- [ ] Support IPv6 addresses

0 comments on commit 99e0a83

Please sign in to comment.