LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   BIND9 - adding subdomain (http://www.linuxquestions.org/questions/linux-networking-3/bind9-adding-subdomain-663062/)

yah0m 08-15-2008 03:49 PM

BIND9 - adding subdomain
 
I'm doing all this via command line, and its really getting confusing... I've managed to get my main domain to resolve and work, but I've got no idea how to get a subdomain added or adding another domain.

What I want to do is put an IRC service on the sub-domain.

Spent a few hours on Google but yet to find a clean example that I can understand. Normally I've done this via CPanel, but I don't feel like spending the extra monthly payment for that when I can do it all via command line.

Mr. C. 08-15-2008 07:29 PM

We will need a little more information.

Is your server the primary name server, or is that your DNS registrar / ISP? If it is hosted by the latter, you must update records on their system. If your are the master NS, you can update your own records.

Please clarify.

yah0m 08-15-2008 07:44 PM

I'm running it off of a VPS, so I guess you could say its the primary name server.

Here is my setup:

named.conf:
Code:

options {
        directory  "/var/named";
        recursion no;
};

zone "domain.org" IN {
        type master;
        file "domain.org.db";
        allow-transfer { 67.*.*.*; };
};


host.domain.org.db:
Code:

$TTL 14400
@      86400    IN      SOA    ns1.domain.org. admin@domain.org. (
                2008021501      ; serial, todays date+todays
                86400          ; refresh, seconds
                7200            ; retry, seconds
                3600000        ; expire, seconds
                86400 )        ; minimum, seconds
host.domain.org. 86400 IN NS ns1.domain.org.
host.domain.org. 86400 IN NS ns2.domain.org.
host.domain.org. IN A 67.*.*.*
localhost.host.domain.org. IN A 127.0.0.1

domain.org.db:
Code:

$ORIGIN domain.org.
$TTL 3h
@        IN SOA ns1.domain.org. host.domain.org. (
                      2008071801        ; Serial yyyymmddnn
                      3h                ; Refresh After 3 hours
                      1h                ; Retry Retry after 1 hour
                      1w                ; Expire after 1 week
                      1h)            ; Minimum negative caching of 1 hour

@                      86400    IN NS    ns1.domain.org.
@                      86400    IN NS    ns2.domain.org.

@                    86400    IN MX 10 smtp.domain.org.

ns1                    86400    IN A    67.*.*.*
ns2                    86400    IN A    67.*.*.*

@                      86400    IN A    67.*.*.*
www                    86400    IN A    67.*.*.*
ftp                    86400    IN A    67.*.*.*


Mr. C. 08-15-2008 07:55 PM

In that case, if you are allowed to edit the zone files, just add a subdomain A record.

If you want a host record irc.domain.org, just add an irc A record just like your www and ftp host records.

If you want an irc host inside a subdomain, just add irc.subdomain as an A record inside the domain.org zone file.

That's it. Oh, and don't forget to update the serial number in any zone file you edit, and then reload named.


All times are GMT -5. The time now is 08:27 AM.