views:

47

answers:

3

Hi guys,

I'm trying to work out a feature for a Web application, but I'm a bit confused at this point. I was wondering if anyone can shed some light on the following scenario.

Say, my Web app is located at domain1.com and a users website is located at domain2.com. What I would like to allow is for the user to be able to map their domain to one of the files/pages on my server. So if someone accesses domain2.com/files then it will internally and transparently route to domain1.com/files.aspx?domain=2 (notice the domain parameter).

I know this can be done with a simple file redirection (301 or 302) on the users server, but I would like to achieve this on the DNS level. How can I go about it?

Thanks in advance!

+1  A: 

You can map domain2.com (or a subdomain) to the same IP domain1.com runs on using the A record. That's about everything you can achieve on DNS level, as it doesn't care about directory structures.

Pekka
A: 

Simply put, you can't. If you wanted to point foo.domain1.com to the record for foo.domain2.com, then you can probably use a CNAME record but DNS has no clue about HTTP URLs.

D.Shawley
Thanks for your reply. With CNAME or an A record, can I have domain1.com/file point to domain2.com/file (viz. identical path)?
NickR
Essentially... `host.domain2.com` would be an `A` record for the IP address of the machine `host`. Then you would create a `CNAME` in `domain1.com` named `host` that refers to `host.domain2.com`. The other option is a `DNAME` with which you can delegate the entire `domain1.com` domain to `domain2.com`.
D.Shawley
A: 

The "HTTP Redirector" plug-in for Simple DNS Plus does just that if you configure it to redirect to "http://domain1.com/files.aspx?domain=#HOST#"

Technically it actually does a HTTP redirect (native DNS is not possible), but it is done at the DNS servers instead of the web-server.

See http://www.simpledns.com/kb.aspx?kbid=1258

Jesper

related questions