Setting up named dns server: Difference between revisions
From D3xt3r01.tk
Jump to navigationJump to search
m New page: ==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 ru... |
m →HOW |
||
Line 21: | Line 21: | ||
<source lang="bash"> | <source lang="bash"> | ||
$TTL 3D | $TTL 3D | ||
@ IN SOA ns1.d3xt3r01.tk. dexter.d3xt3r01.tk. ( | @ IN SOA ns1.d3xt3r01.tk. dexter.d3xt3r01.tk. ( // ns space admin mail separated by . instead of @ | ||
2009112401 ; Serial, todays date + todays serial | 2009112401 ; Serial, todays date + todays serial // serial, be sure to increment it when you change stuff | ||
8H ; Refresh | 8H ; Refresh | ||
2H ; Retry | 2H ; Retry | ||
Line 28: | Line 28: | ||
1D) ; Minimum TTL | 1D) ; Minimum TTL | ||
@ NS ns1 | @ NS ns1 | ||
@ NS ns2 | @ NS ns2 // name server | ||
@ MX 1 mail.d3xt3r01.tk | @ MX 1 mail.d3xt3r01.tk // mail pointer to the main ip with priority 1. | ||
@ TXT "d3xt3r01 main" | @ TXT "d3xt3r01 main" // txt description | ||
ns1 A 174.120.208.202 | ns1 A 174.120.208.202 // normal host -> ip pointer | ||
ns2 A 174.120.208.201 | ns2 A 174.120.208.201 | ||
www A 174.120.208.203 | www A 174.120.208.203 |
Revision as of 22:52, 24 November 2009
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
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.