Current time: 04-20-2014, 04:33 PM Hello There, Guest! (LoginRegister)

Post Reply 
Pointing a subdomain to an ec2 instance
03-26-2012, 02:32 PM
Post: #1
Pointing a subdomain to an ec2 instance
I'm doing some development work for a client, and I'm eventually going to have to install a full LAMP stack server at their site.

Given the latter requirement, I'm doing the development work on an ec2 instance. I'd like them to be able to access the dev site as subdomain.mydomain.com, where mydomain.com is a domain that is hosted here at DH.

Can I just do the following and everything will work? Or am I missing something?

1) create the subdomain (in the Panel)
2) create a CNAME record pointing to the ec2 public IP (in the Panel)
3) create a VirtualHost block for subdomain.mydomain.com (on the ec2 instance)

Thanks
Find all posts by this user
Quote this message in a reply
03-26-2012, 02:46 PM
Post: #2
RE: Pointing a subdomain to an ec2 instance
Skip step 1. You only need to create a subdomain on our end if you want us to do something with the subdomain (like hosting it).

Otherwise that looks good.
Find all posts by this user
Quote this message in a reply
03-26-2012, 03:04 PM
Post: #3
RE: Pointing a subdomain to an ec2 instance
Great. Thanks andrewf.

Will that be subject to the normal DNS dissemination delays? Or are those delays averted because DNS already knows where to find mydomain.com?
What if the ec2 instance goes down, and I have to change the CNAME record to a new instance IP?

Thanks again
Find all posts by this user
Quote this message in a reply
03-26-2012, 03:55 PM
Post: #4
RE: Pointing a subdomain to an ec2 instance
(03-26-2012 03:04 PM)coolgeek Wrote:  Will that be subject to the normal DNS dissemination delays? Or are those delays averted because DNS already knows where to find mydomain.com?
What if the ec2 instance goes down, and I have to change the CNAME record to a new instance IP?

It should be a matter of minutes max (local queue time), as any domain request is already querying the DNS here.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost
Visit this user's website Find all posts by this user
Quote this message in a reply
03-26-2012, 04:05 PM
Post: #5
RE: Pointing a subdomain to an ec2 instance
DNS caching is the issue at hand. If you're querying our nameservers directly, you'll see the new record show up promptly, but if your ISP (or your customers' ISPs) have the records cached, they may continue to see the original value until the cached value expires, which may take up to four hours.
Find all posts by this user
Quote this message in a reply
03-26-2012, 04:12 PM
Post: #6
RE: Pointing a subdomain to an ec2 instance
OP indicates he hasn't actually 'hosted' the subdomain yet so it should be ultra quick, yeah?

Maybe I'm just missing something obvious (need moah coffeez) Big Grin

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost
Visit this user's website Find all posts by this user
Quote this message in a reply
03-26-2012, 04:22 PM
Post: #7
RE: Pointing a subdomain to an ec2 instance
(03-26-2012 04:12 PM)sXi Wrote:  OP indicates he hasn't actually 'hosted' the subdomain yet so it should be ultra quick, yeah?

Maybe I'm just missing something obvious (need moah coffeez) Big Grin

It was a little confusing because I was asking about both situations.

If I understand correctly, it sounds like it should propagate within minutes for the initial creation, but if I need to repoint, it could take up to 4 hours for caches to refresh.
Find all posts by this user
Quote this message in a reply
03-26-2012, 04:25 PM (This post was last modified: 03-26-2012 04:27 PM by sXi.)
Post: #8
RE: Pointing a subdomain to an ec2 instance
Ahh yes! I only answered one question when you had asked two. Definitely time for coffee Big Grin

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost
Visit this user's website Find all posts by this user
Quote this message in a reply
03-26-2012, 04:42 PM
Post: #9
RE: Pointing a subdomain to an ec2 instance
Caching can actually be a problem for nonexistent subdomains as well — many ISPs perform "negative caching" on DNS, so it may take some time for a new subdomain to appear if you've requested it before it was fully created.
Find all posts by this user
Quote this message in a reply
03-26-2012, 05:08 PM
Post: #10
RE: Pointing a subdomain to an ec2 instance
Yeah, negative caching should only occur if the subbie doesn't exist on the DNS when the request is made. I s'pose the best way to get a new one up and running ASAP would be to create the entries, wait a bit™, then issue a lookup from the DH shell locally. Once it exists on DH then you should be safe to fire up the browser.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: