nitefood / asn

ASN / RPKI validity / BGP stats / IPv4v6 / Prefix / URL / ASPath / Organization / IP reputation / IP geolocation / IP fingerprinting / Network recon / lookup API server / Web traceroute server
MIT License
1.33k stars 161 forks source link

fix rDNS #3

Closed Worty closed 4 years ago

Worty commented 4 years ago

The rDNS lookup wasnt working for me because mtr doesnt return the hostnames in -l mode (because of latency i guess?). With this patch its working for me. Please tell me what you think about it.

Without patch: 07-08-2020_21 05 21_89b1353e8e6270077f5ae106f401bfcc With patch: 07-08-2020_21 06 58_8e147127feebd4ef680b88c2b28716c9

btw this is a really great tool

nitefood commented 4 years ago

Hi @Worty,

I've noticed the issue myself, and was pondering a similar solution in order to make dns resolution stronger. I managed to avoid the blocking host call by setting the mtr rounds variable to 10 as opposed to the initial 5, which gives me back hostnames in every test case i ran. It looks like that on your system perhaps DNS resolution takes a little longer. Before merging your PR, I'd like to know if you get any results by increasing that variable to higher values, so as to give mtr (and your nameserver, I guess) more time to resolve. Could you please let me know?

Thanks for your contribution!

Worty commented 4 years ago

Well its very weird im running a local dnsmasq for dns caching so i usally get 0-2 ms response time but even with mtr -l -c 50 www.github.com im not getting any rDNS answers.

Tested on Debian this time instead of Archlinux: 08-08-2020_10 13 15_f5e9c115fd01a6fd4e2f363dfeb1a526

By using host for rDNS you could reduce mtr_rounds back to 5 (or even lower on my tests) for a lower total runtime

nitefood commented 4 years ago

I've implemented your suggestions (dropped dnslines in favor of host lookups + reduced mtr rounds), alongside more speed improvements (mtr now runs asynchronously inside a coprocess), and speed gains are really good in my tests. Please let me know if everything works well for you. Thanks a lot for your feedback!