Forum Moderators: phranque

Message Too Old, No Replies

301 that acts like a host file (or DNS)

redirect that sends the domain name to the ip

         

therealme

6:21 pm on Jan 27, 2010 (gmt 0)

10+ Year Member



Hi,

I have set up a development/staging server, and use DNS to point domains to each.

www.example.com 1.1.1.1
dev.example.com 2.2.2.2

On the dev server I'm using ISPConfig, which uses vhosts for all my sites. I believe this requires the server to have the domain name requested along with the ip (rather than just the IP).

Anyway, some domains the clients own and I don't have the ability to create an A record like 2.2.2.2 dev.example.com. Not a problem for me and the developers, because we just create a hosts file entry. But it's a pain to do that to all the clients, and could potentially cause problems later. Does anyone have an easy solution for this? can I create a bogus domain and 301 redirect it somehow so it looks like the request is for dev.example.com but points to the correct server?

Thanks

jdMorgan

6:39 pm on Jan 27, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> I don't have the ability to create an A record like 2.2.2.2 dev.example.com

If you have access to any DNS server, you do have the ability to do this. Anyone anywhere can point any domain to any server's IP address. So if you have the client's permission, you can define a "dev" subdomain for their domain in your DNS zone file, and point it to the public IP address of your server.

Although this zone file should be seen as 'non-authoritative' for that domain, as long as it does not conflict with an entry in the client's own DNS zone file, it should work just fine.

This entry should be removed from your DNS zone file as soon as the project is concluded, of course.

Jim

therealme

11:44 pm on Jan 27, 2010 (gmt 0)

10+ Year Member



Jim, I totally forgot about that. I'll give it a try and post my results, thanks!

therealme

11:58 pm on Jan 27, 2010 (gmt 0)

10+ Year Member



Of course, my current host won't let me add non-authoritative records, so the questions is, how do I get access to a DNS server? I can install one on a server, but that will take a bit of time. Does anyone know a public one where I can add non-auth records?

jdMorgan

1:37 am on Jan 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is a good reason (among several others) to keeping your domain registration separate from your hosting...

In order to protect the DNS system, it's unlikely you'll find a completely-public resource. I'd suggest you proceed with installing your own -- and making darn sure it's secure.

Jim