0

Originally posted on Stack Overflow.

This may be a question for Server Exchange but I am starting to feel pretty cozy here and I feel like someone here will definitely know the answer. We are currently rebuilding a php site in rails and have the new site that is being rebuilt on a linode box [nginx]. The live domain lives on a slicehost box [also niginx]. Upon launch we are planning on forwarding the complete site to the linode box but would like to set up a subdomain (beta.domain.com) for testing purpose. I know we can do a simple forward / CNAME record but we would like to maintain the same beta.domain.com address.

Any and all help is greatly appreciated.

Note: We currently have complete control over both domains.

1
  • 1
    I'm not sure I follow what you mean by "maintain the same beta.domain.com address". Pre-launch, you want to point beta.domain.com somewhere, post-launch you want to point it somewhere else?
    – gravyface
    Sep 15, 2010 at 14:34

2 Answers 2

0

After re-reading your question several times, I'm not sure I understand what you're asking, but it sounds like you want to do:

Pre-Launch:

  • beta.domain.com resolves to linode box
  • www.domain.com resolves to slicehost

Post-Launch

  • beta.domain.com still resolves to linode box
  • www.domain.com now resolves to linode box

Make sure that you're matching a wildcard on *.domain.com listed in your lighttpd configuration like $HTTP["host"] =~ "(^|\.)domain\.com$" and just change the A record for beta.domain.com to your linode box when you're ready to go.

1
  • Thank you this seems like the best option but we did not end up going that route as we will leave the current linode domain name for testing at the moment. Thanks again!
    – jnolte
    Sep 16, 2010 at 22:15
0

you can have a A/CN entry for a subdomain and a wildcard domain on the same level. the explicitly declared sudbomain (beta.domain.com.) will be treated in favor.

i have it like this:

mail.2x.to.     86400   IN  CNAME   ghs.google.com.
*.2x.to. 86400 IN   A   62.75.210.44

which results in

    joe@joe-laptop:~/Desktop/Crawler$ dig mail.2x.to

; <<>> DiG 9.7.0-P1 <<>> mail.2x.to
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14874
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mail.2x.to.            IN  A

;; ANSWER SECTION:
mail.2x.to.     86400   IN  CNAME   ghs.google.com.
ghs.google.com.     86399   IN  CNAME   ghs.l.google.com.
ghs.l.google.com.   299 IN  A   74.125.43.121

;; Query time: 122 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Wed Sep 15 16:37:47 2010
;; MSG SIZE  rcvd: 92

joe@joe-laptop:~/Desktop/Crawler$ dig catched-by-wildcard.2x.to

; <<>> DiG 9.7.0-P1 <<>> catched-by-wildcard.2x.to
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18119
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;catched-by-wildcard.2x.to. IN  A

;; ANSWER SECTION:
catched-by-wildcard.2x.to. 86400 IN A   62.75.210.44

;; Query time: 268 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Wed Sep 15 16:38:20 2010
;; MSG SIZE  rcvd: 59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .