DNS
Deeks.biz
etc/resolv.conf

[root@linuxhost /etc]# cat resolv.conf
search mydomain.cxm mydomain.cxm
nameserver 127.0.0.1

Notes: The 127.0.0.1 reference is very necessary. If the server is administering just part of the mydomain.cxm domain (let's say corporate), that first line would be

search corporate.mydomain.cxm mydomain.cxm

Note that if there are *ANY* problems in reverse DNS, the existance of this file can cause failure to run telnet, ftp, or sendmail, and can prevent boot. Therefore, it's essential during DNS development and debugging to rename this file before rebooting. If this advice isn't followed, you can bust back in with a boot and rescue diskette and disable whatever is hanging the boot (usually amd and/or sendmail).


/etc/named.conf

options {
directory "/var/named";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};

//
// a caching only nameserver config
//
zone "." {
type hint;
file "named.ca";
};

zone "0.0.127.in-addr.arpa" {
type master;
file "named.local";
};

zone "mydomain.cxm" {
notify no;
type master;
file "named.forward";
};


zone "sqldocs.cxm" {
notify no;
type master;
file "named.sqldocs.cxm";
};


zone "nag.cxm" {
notify no;
type master;
file "named.nag.cxm";
};


zone "102.168.192.in-addr.arpa" {
notify no;
type master;
file "named.102.168.192";
};


zone "200.168.192.in-addr.arpa" {
notify no;
type master;
file "named.200.168.192";
};

Notes: The options block at the top tells the root directory for further DNS files. This is very similar to the version 4 dns.
Zone "." (Named.ca) is a caching file pointing to the world's top level DNS servers.Zone "0.0.127.in-addr.arpa" is reverse DNS for the loopback interface lo. Zone "mydomain.cxm" is forward DNS for the server's domain, and is different from the per-domain files. Zones "sqldocs.cxm" and "nag.cxm" are per-domain forward DNS. Zone "102.168.192.in-addr.arpa" is reverse DNS for the server's subnet (not domain). Zone "200.168.192.in-addr.arpa" is reverse DNS for the websites' subnet (not domain).

This file serves as a roadmap for the rest of your DNS setup. Note how much easier this is than the old named.boot setup.


named.local

@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.

1 IN PTR localhost.

Notes: Forward DNS for the loopback interface (lo). Use exactly as is. It probably comes looking just like this on the Linux distro.
named.forward

@ IN SOA ns.mydomain.cxm. hostmaster.mydomain.cxm. (
1999021004 ; serial, todays date + todays serial #
8H ; refresh, seconds
2H ; retry, seconds
1W ; expire, seconds
1D ) ; minimum, seconds

NS ns ; Inet Address of name server
MX 10 mail ; Primary Mail Exchanger

localhost A 127.0.0.1
ns A 192.168.102.3
linuxhost A 192.168.102.3
mail A 192.168.102.3
www A 192.168.102.3

Notes: This is the forward DNS for the server's domain. The meaning of the @ sign on the first line is the Zone variable string in /etc/named.conf, so in this case it's mydomain.cxm. Note that except in the first line, the word "IN" is now optional. The localhost A line is necessary for proper DNS server functioning. The ns A line provides portability, so if the name server is changed, the ip is changed here but everything else remains the same. Linuxhost is the actual hostname of the machine, mail is an alias (though it's done with A, not CNAME) used in mail routing, and www is an http alias.
named.sqldocs.cxm

@ IN SOA ns.mydomain.cxm. hostmaster.mydomain.cxm. (
1999021005 ; serial, todays date + todays serial #
8H ; refresh, seconds
2H ; retry, seconds
1W ; expire, seconds
1D ) ; minimum, seconds

NS ns.mydomain.cxm. ; Inet Address of name server
MX 10 mail.mydomain.cxm. ; Primary Mail Exchanger

@ A 192.168.200.146
www A 192.168.200.146

Notes: I'm using the 192.168.102.3 as the mail exchanger, so the only significance here is that @ (sqldocs.cxm) and alias (but not aliased wth CNAME) map to 192.168.200.146, a virtual IP hung off the lo interface.
named.nag.cxm

@ IN SOA ns.mydomain.cxm. hostmaster.mydomain.cxm. (
1999021005 ; serial, todays date + todays serial #
8H ; refresh, seconds
2H ; retry, seconds
1W ; expire, seconds
1D ) ; minimum, seconds

NS ns.mydomain.cxm. ; Inet Address of name server
MX 10 mail.mydomain.cxm. ; Primary Mail Exchanger

@ A 192.168.200.148
www A 192.168.200.148

Notes: I'm using the 192.168.102.3 as the mail exchanger, so the only significance here is that @ (nag.cxm) and alias (but not aliased wth CNAME) map to 192.168.200.148, a virtual IP hung off the lo interface. Note the only distinction between this file and named.sqldocs.cxm above it is the ip address of @. This is the beauty of version 8. To add a new website to the series, copy another per-domain forward file, then change the ip. This is why I chose not to put comments in these files -- too much likelihood of the comments becoming misleading with copying.


named.102.168.192

@ IN SOA ns.mydomain.cxm. hostmaster.mydomain.cxm. (
1999021004 ; Serial, todays date + todays serial
8H ; Refresh
2H ; Retry
1W ; Expire
1D) ; Minimum TTL
NS ns.mydomain.cxm.


3 PTR linuxhost.mydomain.cxm.
3 PTR ns.mydomain.cxm.
3 PTR mail.mydomain.cxm.
3 PTR www.mydomain.cxm.

Notes: Reverse DNS for the 192.168.102 subnet (the server's subnet).Simply define PTR records for each name for each IP in the subnet. Note that where several names go with a single IP, reverse DNS will bring back the first PTR record for that IP.
named.200.168.192

@ IN SOA ns.mydomain.cxm. hostmaster.mydomain.cxm. (
1999021004 ; Serial, todays date + todays serial
8H ; Refresh
2H ; Retry
1W ; Expire
1D) ; Minimum TTL
NS ns.mydomain.cxm.


146 PTR sqlocs.cxm.
146 PTR www.sqlocs.cxm.

148 PTR nag.cxm.
148 PTR www.nag.cxm.

Notes: Reverse DNS for the 192.168.200 subnet (the series of websites with virtual IPs hung off the lo interface).Simply define PTR records for each name for each IP in the subnet, generally one with just the domain and one with a prepended www. Note that where several names go with a single IP, reverse DNS will bring back the first PTR record for that IP. Note that if individual domains had their own mail servers or ftp servers or anything like that, those would get PTR records here too.

WWW Friends SNES Holidays Facebook me! page counter Get Firefox Valid HTML 4.01! Valid CSS! Apache Powered MYSQL Powered PHP Powered
Admin Stats