An open API service indexing awesome lists of open source software.

https://github.com/mersinvald/batch_resolve

Fast asynchronous DNS batch resolver
https://github.com/mersinvald/batch_resolve

async batch-processing dns dns-client futures resolve rust tokio

Last synced: 5 months ago
JSON representation

Fast asynchronous DNS batch resolver

Awesome Lists containing this project

README

          

[![Crates.io](https://img.shields.io/crates/v/batch_resolve_cli.svg)](https://crates.io/crates/batch_resolve_cli)
[![Gitter](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/batch_resolve/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/mersinvald)

This page in [Russian](README_RUS.md)

# Batch Resolve

Fast asynchronous DNS resolver

## Support notice

`batch-resolve` isn't actively maintained anymore, but I'll be happy to accept Pull Requests and release new versions, if anyone would be desperate enough to try and dig through the futures 0.1 spaghetti :)

If you use this tool and encounter critical bugs, let me know in the issues -- I'll try to find time to take a look.

## Install
### Distro packages
There are prebuilt *deb* and *rpm* packages for x86_64 you can find within the releases in [the list of versions](https://github.com/mersinvald/batch_resolve/tags)

Arch Linux users can install the package [from AUR](https://aur.archlinux.org/packages/batch_resolve/)

Packages install the config file into /etc/batch_resolve.toml
### Static binary
Every release binary can be found in the [the list of versions](https://github.com/mersinvald/batch_resolve/tags). Just place it to one of directories in your PATH (e.g. /usr/bin)

### Install from crates.io
If you have rust toolkit installed, you can install *batch_resolve* with
```
cargo install batch_resolve_cli
```

## Usage

Input and output format is list delimited with new line.
Consider such input `domains.txt`
```
google.com
rust-lang.org
mozilla.org
```

Resolve all `A` records:
```
batch_resolve --in domains.txt --out hosts.txt --query A
```

Resolve `A` and `AAAA` records:
```
batch_resolve -i domains.txt -o hosts.txt -q A
-i domains.txt -o hosts.txt -q AAAA
```

### Configuration
By default batch_resolve uses Google DNS servers `8.8.8.8` and `8.8.4.4` and retries `10` times on Connection Timeout error.
These and Queries Per Second parameters may be altered in configuration file.

Configuration file may be placed in the following locations (priority descending):
```
batch_resolve.toml
$HOME/.config/batch_resolve.toml
/etc/batch_resolve.toml
```

Configuration includes DNS servers, queries per second amount and retries on failure count
```toml
# DNS servers are only accepted as socket addresses
# If port is not specified default DNS :53 port will be used
dns = [
"8.8.8.8",
"8.8.4.4"
]

# How many queries to perform per second
# WARNING: Google Public DNS guaranteed to handle 500 requests per second max
# Please make sure that resolve results do not vary with higher request rates
# before using high QPS configuration in production.
# Alternatively you can use your own local caching DNS server.
queries_per_second = 500

# Times to retry on connection timeout
retry = 5
```

Configuration template can also be found [here](batch_resolve.toml)

## Contributing

To build project please clone the repo
```
git clone git@github.com:mersinvald/batch_resolve.git
```
And run `cagro build`
```
cd batch_resolve
cargo build
```
`batch_resolve` can be build with stable rust

Please file an issue if you have any improvement suggestion or bug report.

Pull Requests are welcome also!

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgement
* [TRust-DNS: A Rust based DNS client and server, built to be safe and secure from the ground up](https://github.com/bluejekyll/trust-dns)
* [rust-musl-builder: Docker container for easily building static Rust binaries](https://github.com/emk/rust-musl-builder)gi

## Donate

If you feel that this work is worth something and that it saved your time you can give me a cup of coffee :)

* [Donate with PayPal](https://www.paypal.me/mersinvald)
* [Donate with yandex.money](http://yasobe.ru/na/batch_resolve_coffee)