Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a dev environment and a production environment.

The production environment lives at on one server (

On a totally separate server (different host, everything), I have (77.765.43.21).

I'm trying to create a subdomain on the development server: I tried to add an entry to the dev DNS zone file: CNAME

But, it is still not working. Do I have to do anything else, or is what I've done wrong?

share|improve this question

migrated from Jul 14 '11 at 22:48

This question came from our site for professional and enthusiast programmers.

Show your existing DNS configuration. – Ignacio Vazquez-Abrams Jul 14 '11 at 22:51

3 Answers 3

your whole approach seems kind of odd but if you insist on creating a sub-domain named go ahead and edit the DNS with an A record for it. 77.765.43.21

Next you need to edit the Apache.conf file and add as either a "ServerName" or "ServerAlias".

share|improve this answer

You don't add an entry to the dev zone. In fact you shouldn't even have a dev zone. Everything should be done in example zone.

share|improve this answer

There are two approaches you can take here:

  1. keep everything in the zone file, or
  2. delegate to a separate name server.

Option 1 is simple: you keep everything in the same file, and there's no need to set up a second server. The disadvantage is that your production and development DNS settings are in the same file, which may not be what you want -- especially if you're as prone to typo'ing config files as I am!

If you go this route, your zone file should look something like this: # # SOA, NS, etc.

@        IN A
dev      IN A       77.765.43.21 IN CNAME   dev

If you don't terminate a label with a dot character, the zone name is automatically appended.

Option 2 is a bit more complicated: you need to set up a second DNS server to host the domain. If you're trying to replicate a production environment, this could be what you want. It would look like this, assuming that your second nameserver lives on

# SOA, NS, etc. 

@        IN A
dev      IN NS

and for the other zone:

# SOA, NS, etc.
@        IN A       77.765.43.21
dev2     IN A       77.765.43.21

This delegates authority over the entire domain to nameserver, in the same manner that .com delegates to your current nameserver.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.