title: Getting domain host name in ruby
body: <p>Is there a possible way to get the domain's hostname in ruby? </p>
  
  <p>For example:</p>
  
  <pre><code>$ host api.heroku.com
  api.heroku.com is an alias for api-default.herokussl.com.
  api-default.herokussl.com is an alias for elb027033-298234319.us-east-1.elb.amazonaws.com.
  elb027033-298234319.us-east-1.elb.amazonaws.com has address 23.23.76.65
  elb027033-298234319.us-east-1.elb.amazonaws.com has address 23.21.240.208
  elb027033-298234319.us-east-1.elb.amazonaws.com has address 107.22.242.236
  </code></pre>
  
  <p>host would be the best example, because it'll also show if the domain/subdomain is pointing to another host like amazonAWS or etc.</p>