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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sorry this is a repost, the original question got moved to here form stack overflow and for some reason I can't comment or respond to answers on that one anymore.

Hi all, I'm trying to set up a virtual host for I've edited the httpd.conf file and now I'm trying to edit my DNS settings. However, I'm not sure exactly what to do. Here's an snippet of what's already in the named.conf file (the file was made by someone else who is unreachable):

zone "" {
    type master;
    file "";
    allow-transfer {

I figure if I want to get working, I need to copy that entry and just replace with but will that work? I was under the impression I needed a .db file but I don't see any reference to one in the current named.conf file. I also don't see any .db files or files named SITENAME in named.conf's directory. Any ideas where these illusive pre-existing db files could be?

share|improve this question
I've merged the questions for you. For future reference, the best thing to do if that happens is flag for mod attention and we'll get you fixed up instead of reposting :) – Zypher Dec 31 '10 at 3:47
up vote 4 down vote accepted

This question is better suited for serverfault. Do post this kind of admin and server related questions there in the future.

But since you posted here for now, here's the solution:

The file where your domain specific settings should go is specified on this line: file "";

Thus you need to open/create SITENAME.COM zone db file in the same directory where you opened named.conf.

A typical zone db config would look like this:

    @ IN SOA (
    19990811    ; Serial number
    3600        ; 1 hour refresh
    300     ; 5 minutes retry
    172800      ; 2 days expiry
    43200 )     ; 12 hours minimum

    IN NS
    IN NS

    IN MX

    IN HINFO    Pentium/350 LINUX

; A list of machine names & addresses    IN A   ; OpenVMS Alpha     IN A   ; Linux (main server)     IN A   ; Windows NT (blech!)

; Including any in our other class C's   IN A  ; Linux test machine   IN A  ; Linux devel. kernel

; Alias (canonical) names
    gopher          IN CNAME
    ftp     IN CNAME
    www     IN CNAME

And if your current domain name resolves you most probably have some kind of configuration already in SITENAME.COM file. Then all you need to do in order to add the subdomain is to do a CNAME or FORWARD record for that like so:

redmine     IN CNAME    SITENAME.COM.


redmine     IN A

Do modify the ip address or CNAME to what you need.

For more in-depth info check this article on

share|improve this answer
Thanks for the great answer, I just have a quick follow up. Any idea why are there no other .db files in the directory you mention, despite there being other domains mentioned in the named.conf file? – Jake Jan 1 '11 at 20:51
You should check the respective zone records file entries for those domains in named.conf. If they are specified and those files don't exist that will most probably generate errors in BIND. You should be able to see those in the logs or upon starting the server. If no file entry is specified for those domain in named.conf those domains most probably weren't configured and left as is or they are slave or forward zones. – Shinnok Jan 1 '11 at 21:01

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.