named.conf - The file which holds it all together.
You'll normally find named.conf to be in /etc so we'll start there
Open up /etc/named.conf in your text editor of choice. (Personally I like nano, I'll use vim where nano isn't available)
We have to define some important things here
We'll set the options for named firstly
Code:
options {
directory "/var/named"; //Tell named where to find everything
allow-transfer { none; }; //Don't let anybody preform a zone transfer
allow-recursion { localhost; }; //We don't want to be an open dns server
// Use your ISP's or run your own damnit
version "DNS Server"; //Set the version reply, so if anyone is profiling the //network, it makes it harder for them
};
Now you have the basic config for a
DNS server but its pretty useless at the moment! It doesn't know where to look for
DNS queries or what zones it is serving, we'll tell it where to find other
DNS servers
Change directory so you are now in /var/named
We're going to have to download a little file here from the people who run the root
dns servers
Run this to download that file:
wget
http://www.internic.net/zones/named.root
You should now have a file called named.root in /var/named. Don't worry about keeping this up to date or anything, the last change was made in 2004
Just to be sure set the permissions of that file:
chown named:named named.root
Now head back into editing /etc/named.conf
Add this to the bottom of the configuration (outside of the options bracket)
Code:
zone "." {
type hint;
file "/var/named/named.root";
};
So you should now have a file looking like this
Code:
options {
directory "/var/named"; //Tell named where to find everything
allow-transfer { none; }; //Don't let anybody preform a zone transfer
allow-recursion { localhost; }; //We don't want to be an open dns server
// Use your ISP's or run your own damnit
version "DNS Server"; //Set the version reply, so if anyone is profiling the //network, it makes it harder for them
};
zone "." {
type hint;
file "/var/named/named.root";
};
Now part 3 will show how to set up named so it serves zones.