| free hosting image hosting hosting reseller online album e-shop famous people | ||
![]() ![]() |
||
Setting Up a NameserverA nameserver is a server that resolves hostnames to IP addresses. Instead of having to type in "209.81.10.250", I can just type in "www.computing.com" to get to a site. BIND is nameserver software that runs on many types of machines, originally written by Paul Vixie and now maintained by the Internet Software Consortium (ISC). This was one of the trickiest things I've had to try to figure out so far. I didn't talk to anybody as to how to go about this, unlike PPP setup. But I finally found the Linux DNS HOWTO and used that. Hopefully this will save you some trouble. Here I have instructions for BIND 8, which is newer and more advanced than BIND 4 (which some distributions still use). Removing Old Nameserver (BIND 4) I had to remove the old nameserver first, so it wouldn't
get in the way of the new one. Installing New Nameserver (BIND 8)
Configuration: /etc/named.confConfiguring the nameserver was probably the hardest part of the process that I had to go through. Hopefully, what I've written up about what I learned will save the reader some trouble. The main BIND 8 configuration file is in /etc/named.conf. The configuration syntax for the file is documented at http://www.isc.org/bind8/config.html. Here's a sample of a configuration file (as /etc/named.conf), with an explanation below. /* * A simple BIND 8 configuration */ options { directory "/var/named"; }; zone "computing.com" in { type master; file "master/computing.com"; }; zone "0.0.127.in-addr.arpa" in { type master; file "zone/127.0.0"; }; zone "." in { type hint; file "named.cache"; }; In "options" I only had one option: where the directory for zone files were. Zone files are where information about domains is stored, and each file has information about a zone. It's a section to cover, I guess, so that's why they're called zones. I have /var/named/ as my named data directory. The "computing.com" section is pretty straightforward. It just indicates the location of the computing.com zone files and tells named that this server is a master nameserver for the computing.com zone. The "0.0.127.in-addr.arpa" zone is for mapping localhost to 127.0.0.1, basically. It has its own zone file. The "." zone indicates a caching nameserver; that is, someone can actually use your machine to resolve hostnames (including you). I've heard that is is efficient especially when using PPP connections, but I don't know for sure. Read the "Caching Nameserver" section to read up on how to create one. Caching Nameserver First you need to get a "named.cache" file. I'm not sure if you can name it anything else, but let's just use that filename. In /var/named/ (or wherever you put your nameserver's data files), type dig @a.root-servers.net > named.cache. This will ask for the addresses of the main DNS servers of the Internet and direct them to a file. I'm guessing that the purpose of this is to give your machine an idea of which machines on the Internet to ask about hosts. Periodically, like once a month, update the named.cache file by running that command once in a while. You can use a cron job for that. If you don't know what I'm talking about here, don't worry about it. Just be sure to update it using dig once in a while, that's all you have to do. You have /etc/named.conf point to wherever your named.cache file is under the "." zone. Zone Files in /var/named/ In /var/named/, I created directories for every type of zone I had. The directories I have in there are: master, slave/, and zone. With the domain name system, there is a server for each domain that is the main server (the master). I suppose that the slave server is there in case the main (master) server is down. For each domain there should be at least 2 servers, one master and one slave. That's just the way it goes. While interning at Penguin Computing I set up both the master and slave DNS servers. The master's information should go in the master directory. You should be able to figure out where the slave's information goes. The information they store is the same, but since one machine is the main one that keeps the information (master) and the other simply follows the master's information (slave), you need to stay organized and make sure you're configuring the right machine for its right place in the nameserver system. Note that the slave nameserver for one domain can also be the master nameserver for another domain. There just can't be two masters for a single domain, though I think there can be several slaves. Examples of Zone Files To figure something like this out, I was looking hard for examples. And examples really help, so hopefully you won't be too confused by my examples. Hey, I try. Domains The information for each domain is put in a single file. This file contains valuable information for each domain, such as machines that are under that domain (like, for the computing.com domain, the nameservers would have the information for what IP address pasta.computing.com gets and the one that antarctica.computing.com gets). Here's an example of a domain's records: @ IN SOA computing.com. root.computing.com. ( 1998082403 ; serial 4H ; refresh, seconds 2H ; retry, seconds 1W ; expire, seconds 1D ) ; minimum, seconds NS pasta.computing.com. NS rice.computing.com. MX 10 computing.com. ; Primary Mail Exchanger localhost A 127.0.0.1 router A 140.174.204.2 computing.com. A 209.81.10.250 ns A 209.81.10.250 www A 209.81.10.250 ftp CNAME computing.com. mail CNAME computing.com. news CNAME computing.com. pasta CNAME computing.com. slashdot CNAME computing.com. rice CNAME antarctica.computing.com. antarctica A 209.81.10.252 antarctic CNAME antarctica.computing.com. www.antarctic CNAME antarctica.computing.com. www.antarctica CNAME antarctica.computing.com. zork A 209.81.10.253 tux A 209.81.10.146 xfce A 209.81.10.252 @ TXT "Penguin Computing" @ HINFO Linux 2.0.34 There's a pretty weird syntax to be used for these zone files. I never would have figured it out on my own had I not read the Linux DNS HOWTO document. Basically, it specifies information about all the machines in the domain, and it contains information about the domain itself, such as the type of machine the server is running on. I'll start explaining what all the stuff does. In the
first line, it's saying that this |