batch_resolve | Fast asynchronous DNS batch resolver | DNS library
kandi X-RAY | batch_resolve Summary
kandi X-RAY | batch_resolve Summary
This page in Russian.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of batch_resolve
batch_resolve Key Features
batch_resolve Examples and Code Snippets
batch_resolve.toml
$HOME/.config/batch_resolve.toml
/etc/batch_resolve.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 t
google.com
rust-lang.org
mozilla.org
batch_resolve --in domains.txt --out hosts.txt --query A
batch_resolve -i domains.txt -o hosts.txt -q A
-i domains.txt -o hosts.txt -q AAAA
git clone git@github.com:mersinvald/batch_resolve.git
cd batch_resolve
cargo build
Community Discussions
Trending Discussions on batch_resolve
QUESTION
There is an evident lapse in my understanding on concurrent development in Rust unfortunately. This question stems from weeks repeated struggles to solve a seemingly "trivial" problem.
Problem DomainDeveloping a Rust library, named twistrs that is a domain name permutation and enumeration library. The aim and objective of the library, is to be provide a root domain (e.g. google.com
) and generate permutations of that domain (e.g. guugle.com
) and enrichment that permutation (e.g. it resolves to 123.123.123.123
).
One of its objectives, is to perform substantially faster than its Python counterpart. Most notably, network calls such as, but not limited to, DNS lookups.
Currently Design ProposalThe idea behind the library (apart from being a learning ground) is to develop a very trivial security library that can be implemented to meet various requirements. You (as a client) can choose to interact directly to the permutation or enrichment modules internally, or use the library provided async/concurrent implementation.
Note that there is no shared state internally. This is probably very inefficient, but somewhat meaningless for the time being as it prevents a lot of issues.
Current ProblemInternally the DNS lookup is done synchronously and blocks by nature. I'm having trouble turning this into concurrent code. The closest I could get was to use tokio mpsc channels, and perform spawn a single tokio task:
...ANSWER
Answered 2020-Aug-23 at 17:44Edit: I misinterpreted your question and didn't realize that the DNS resolution itself wasn't asynchronous. The following approach won't actually work with synchronous code and will just result in the executor stalling because of the blocking code, but I'll leave it up in case you switch to an asynchronous resolution method. I'd recommend using tokio's asynchronous lookup_host()
if that fits your needs.
Async executors are designed to handle large numbers of parallel tasks, so you could try spawning a new task for every request, using a Semaphore
to create an upper bound on the number of running tasks at once. The code for that might look like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install batch_resolve
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page