Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Firstly I successfully have a domain working in a chroot named. There are files in /var/named/chroot/var/named called and named.local and named.root.

Also in /var/named/chroot/etc there is named.conf.

So works as both a hosted website and it has and

Now what I want to do is only to add another domain to this setup, however I'm having trouble to find tutorial articles on adding another domain. They mostly seem to focus on just the adding of the first domain.

I guess I have to create a new zone file and reference it in the named.conf but I don't know what the zone file should contain. I tried some trial and error guessing but it didn't work.

share|improve this question

1 Answer 1

You add the second domain the same as the first -- create an entry in /var/named/chroot/etc/bind/named.conf referring to the new zone and its filename (easiest way is to copy over the line from and rename mydomain to mydomain2 on all points of the line, then copy over to and edit the new file to reflect the differences between and

You can (and probably should) use the same NS and MX records for both domains.

ETA: The line in named.comf will look roughly like this:

zone "" { type master; file ""; };

A proper hosts file looks something like this:

@               IN      SOA (
                2011060701 ; serial
                28800      ; refresh
                7200       ; retry
                604800     ; expire
                86400)     ; minimum
; Nameserver(s) for the domain
@               IN      NS
                IN      NS
                IN      NS
; Mail server(s) in the domain
@                   IN      MX      10
                    IN      MX      20      some.fallback.server.
; Address record(s) for the domain 
localhost      IN      A     
@              IN      A     
www            IN      CNAME 
mail           IN      A     
pop3           IN      CNAME           mail

Note that any FQDN name HAS to end with a . or bind will implicitly tack after it. Lines preceded by a semicolon are comments.

share|improve this answer

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.