CNAME lookup with ruby

  • Thread starter Oliver Nightingale
  • Start date
O

Oliver Nightingale

Hi,

I want to be able to use ruby to look up a particular CNAME domain and
see where it is pointing to, is there a way to do this with the ruby DNS
lookup libraries?

To clarify I have an application where each user has a subdomain like
user.example.com and I want the user to be able to set up a CNAME record
to this subdomain.

Then I want to use some middleware to be able detect that the
application is being accessed from a custom domain, then lookup where
the custom domain is pointed to, e.g. user.example.com, and then change
the request to this address so the whole thing is hidden from my app.

Any help or suggestions are very welcome!
 
E

Eric Hodel

I want to be able to use ruby to look up a particular CNAME domain and
see where it is pointing to, is there a way to do this with the ruby
DNS
lookup libraries?

look at Resolv, it allows you to perform arbitrary DNS lookups.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,458
Latest member
Chris#

Latest Threads

Top