DEV Community

Cover image for Did you know Ruby has resolv-replace?
Yuta Miyama
Yuta Miyama

Posted on

1

Did you know Ruby has resolv-replace?

In Ruby, there's a library called resolv-replace.

This is a drop-in replacement (moneky patch) of libc DNS resolver Ruby's using under the hood. It'll use a pure Ruby implementation called Resolv.

The doc states the merit of Resolv as "Resolv can handle multiple DNS requests concurrently without blocking the entire Ruby interpreter". So ppl probably reach out to this when they want to improve the performance.

You can read how resolv-replace is patching a set of Ruby's stdlibc network calls at https://ruby-doc.org/stdlib-2.7.0/libdoc/resolv-replace/rdoc/index.html.

If you'd like more control on the DNS layer due to how your app's constructed, I'd recommend checking out this library.


Cover Photo by JJ Ying on Unsplash

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More