Monday, January 17, 2011

BIND

What's new in Bind?

I was in for quite a surprise when I built a new Fedora Core 3 server. Security was much higher making things a bit more inconvenient and definitely confusing. Specifically the files paths changed from /var/named to /var/named/chroot/var/named. It looks like this is a security measure that protects the really important system file locations by emulating them to the user of the Bind service. As soon as you know about the location of the new path, everything makes sense again. Just refer to the file paths below:

Location and Purpose of Bind DNS Files

  • /etc/named.conf - Configuration file for the DNS server. In order for a domain to be handled by the DNS server, it must be listed in this file.
  • /var/named/chroot/var/named/domain.db
    /var/named/domain.db - old path
    A domain table (notice the folder in which it is stored).
  • /var/named/chroot/var/named/x.x.x.x.reverse.db
    /var/named/x.x.x.x.reverse.db - old path
    - Files containing reverse DNS info (x.x.x.x is class C network)
  • /var/named/chroot/var/named/named.ca
  • /var/named/named.ca - old path
    - Contains a list of all the master DNS servers on the Internet.

Adding a Domain

Step 1:  Edit /etc/named.conf and add the zone of the new domain. Save and Exit.
Example:  
zone "newdomain.com" IN {
     type master;
      file "newdomain.db";
};
Step 2:  Change directory to /var/named.
Type: cd /var/named/chroot/var/named.
Step 3:  Copy new domain template to the new domain. (/var/named/chroot/var/named/nd is the template file)
Type: cp nd newdomain.db 
Step 4:  Edit /var/named/chroot/var/named/newdomain.db and change settings to reflect your new domain name. Don't forget to also update the serial! (the date line of the file)
Step 5:  Once you have made the proper changes to newdomain.db, save the file. You must now restart the name server in order for the changes to become active. From the Linux prompt,
type: rndc reload
Step 6:  Check the system log to verify that the zone (domain) was loaded and that no errors occurred.
Type: tail /var/log/messages
Step 7:  If you have any secondary DNS servers, edit /etc/named.conf and add the zone of the new domain & Then reload the Name Server.
Example:
zone "newdomain.com" IN {
    type slave;
    file "newdomain.db";
   masters { Primary.DNS.Server.IP; };
};
Step 10:  You must now restart the name server in order for the changes to become active. From the Linux prompt, type: rndc reload (rndc is in new version of bind)
Step 11:  Check the system log to verify that the zone (domain) was loaded and that no errors occurred.  Type the alias: tmess

CNAME:  The CNAME in the DB file creates an alias to an address.
Example:  Pointing a domain such as newdomain.org to newdomain.com. In the newdomain.org DB file, adding a line such as: 
www   1D   IN   CNAME  www.newdomain.com.
This line will make an alias from www.newdomain.org and point it at www.newdomain.com

0 comments:

Post a Comment

 
Design by Laikeng | Bloggerized by Storesu - sutoday | Court