Setting up named dns server

From D3xt3r01.tk
Revision as of 22:14, 25 January 2012 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

WHY

Because I'm setting up a new server and didn't get the chance to post a "how to" on how I do it. I'm sure there are stuff I do wrong, but .. the basics work.

HOW

My named runs as a chroot. My zone files are in /var/named/chroot/var/named/pri . My named.conf is in /var/named/chroot/etc/named.conf .

The new domain I'll set up is named d3xt3r01.tk . First, edit /var/named/chroot/etc/named.conf:

zone "d3xt3r01.tk" {
        type master;
        file "pri/d3xt3r01.tk.zone"; // Relative path to chroot
        notify no;
};

Now I edit /var/named/chroot/var/named/pri/famouswhy.com.zone like this:

$TTL 3D
@       IN      SOA     ns1.d3xt3r01.tk. dexter.d3xt3r01.tk. ( ; ns space admin mail separated by . instead of @
                        2009112401 ; Serial, todays date + todays serial ; serial, be sure to increment it when you change stuff
                        8H      ; Refresh
                        2H      ; Retry
                        4W      ; Expire
                        1D)     ; Minimum TTL
@               NS      ns1
@               NS      ns2 ; name server
@               MX      1       mail.d3xt3r01.tk ; mail pointer to the main ip with priority 1.
@               TXT     "d3xt3r01 main" ; txt description
@               A       174.120.208.203 ; domain without www pointer
ns1             A       174.120.208.202 ; normal host -> ip pointer
ns2             A       174.120.208.201
www             A       174.120.208.203
mail            A       174.120.208.204

Reboot the named and set up ns1 and ns2 to those ips in your dns config panel and wait 24-72 hours for the changes to commit.