socketry / async-dns

An asynchronous DNS resolver and server.
MIT License
96 stars 14 forks source link

Access to the request IP #10

Closed brandonhilkert closed 5 years ago

brandonhilkert commented 5 years ago

Hey thanks so much for these gems! I assumed I'd have to deal with another language to put up a service like this.

We're looking to do a filter service based on request IP. With a downloaded ruleset from our services, look up the rules for that request IP, determine if it should be allowed, if allowed passthrough to a forwarding bind server, if not, serve backed an IP for a blocked page.

Two questions:

  1. Is there an easy way to access the request IP? I was having trouble following the sequence of the request in to the transaction.
  2. There are a lot of examples in rubydns, do you recommend using this dependency to build something like the above, or using rubydns as a starting point? The rules in rubydns didn't seem to match our requirements.
brandonhilkert commented 5 years ago

Ah, my bad, just found it in the options attr of the transaction. Thanks again!

brandonhilkert commented 5 years ago

I'd still be interested in your thoughts on 2 :)

ioquatix commented 5 years ago

RubyDNS was originally the entire stack. It split into async + async-dns + rubydns. RubyDNS is old, and it only really exists for compatibility or when you have a specific need for a DSL.

So, for 2, I'd suggest just building directly on top of async-dns.

Also, if you are building a commercial project and it's successful, please consider supporting the continued maintenance and development of async and async-dns :)