Giter Club home page Giter Club logo

Comments (7)

alaz avatar alaz commented on June 23, 2024

Hi,

My guess is that is is an inconsistency between the forward and the reverse DNS records. Most likely Google dynamically and frequently updates the crawler's DNS records. So my theory is that sometimes the forward resolves correctly, but the reverse returns NXDOMAIN because it was not in the cache and hence the result is more up-to-date.

Does it make sense to you?

from legitbot.

inspire22 avatar inspire22 commented on June 23, 2024

Interesting. I have only a loose understanding of dns but I'd thought it'd propagate up to a master copy if it can't find a record?

Any tips how to solve it best in a rack-attack block? Or should it be fine to just rescue the exception?

from legitbot.

alaz avatar alaz commented on June 23, 2024

I'd thought it'd propagate up to a master copy if it can't find a record?

Yes. Local / closest DNS servers cache records. Consider your closest DNS server has a forward record in its cache and returns it. But it has to go further in the chain to get the result for a reverse query and gets NXDOMAIN in return, because it does not exist anymore.

from legitbot.

inspire22 avatar inspire22 commented on June 23, 2024

Does rescuing the exception seem like a decent plan, or does it open up other bots? Or should this be something rescued in the gem itself.

from legitbot.

alaz avatar alaz commented on June 23, 2024

Yes, rescuing the exception in a calling code might open the door for other bots. It should be rescued in the same way as for forward resolv:

def reverse_domains(ip)
resolver.getnames(ip)
rescue Resolv::ResolvError
nil
end

from legitbot.

alaz avatar alaz commented on June 23, 2024

Published as 1.6.0

from legitbot.

inspire22 avatar inspire22 commented on June 23, 2024

Awesome, thanks!

from legitbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.