rapp

Handling DNS

You can change the DNS your Application responds to at any given time. That’s done using the change_dns command.

Here’s how it’s used:

$ wn change_dns rubyista.info
[Webbynode] Changing DNS to rubyista.info...
            Creating DNS entries for www.rubyista.info and 
              rubyista.info...
            Your application will start responding to rubyista.info 
              after next deployment.

Note that, if you use a domain, it will setup both domain.com and www.domain.com. Now with a subdomain, that won’t happen:

$ wn change_dns subdomain.rubyista.info
[Webbynode] Changing DNS to subdomain.rubyista.info...
            Creating DNS entry for subdomain.rubyista.info...
            Your application will start responding to 
              subdomain.rubyista.info after next deployment.

And next time you push your app, it will start responding to this new DNS entry.

Wildcards

Important: Wildcards support require Webbynode gem version 1.0.3 (current in beta) or greater

For applications that uses subdomains, a wildcard domain may be necessary. To use a wildcard DNS with Rapp, just change the DNS using “*.yourdomain.com”, like this:

$ wn change_dns \*.rubyista.com
[Webbynode] Changing DNS to *.rubyista.com...
Creating DNS entry for *.rubyista.com...
Your application will start responding to 
  *.rubyista.com after next deployment.

Next time you push your app you will note the following output:

$ wn push
[Webbynode] Pushing r3app
Counting objects: 146, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (122/122), done.
Writing objects: 100% (146/146), 94.78 KiB, done.
Total 146 (delta 34), reused 0 (delta 0)
remote: Checked out master branch
remote: 
remote: ----------------------------
remote:   Webbynode git deployment 
remote: ----------------------------
remote: 
remote: Apache webserver detected...
remote: Deploying application r3app as *.rubyista.com...
remote: 
remote: Configuring addons...
remote: 
remote: Configuring Rails 3 application...
remote:   => Configuring apache vHost...
remote:      Setting up wildcard alias...
(...)

After that, your application will start responding to anything that ends with the domain you specified, in this case rubyista.com.

Comments
blog comments powered by Disqus