Linux Server How ToHow To Setup, Configure, Manage and Secure a Linux Server |
|
Home Which Linux Distribution? Linux Server Hardware Linux Server Security Linux Web Server - Apache Linux DNS Server - Bind Introduction to Bind Install Bind With Apt-get Install Bind From Source Bind Compile Options Configuring Bind Caching DNS Config Authoritative DNS Config Zone Files Download New Named.Root Linux DHCP Server - DHCPD Linux Mail Server - Sendmail LDP How To's About This Site |
Linux Server How To - Install the BIND DNS Server From SourceInstalling the BIND DNS Server From SourceCompiling the BIND DNS server from source is easy to perform. We will assume that the reader has no prior knowledge of compiling from source but has root privileges and the basic skills required to operate their Linux server. There are several reasons why you may want to compile BIND from source, your chosen distribution may not have support for apt or rpm packages or you may simply require a higher level of control over the level of functionality is needed and where things are installed.Get the Latest BIND Source CodeTo compile your BIND DNS server you will require the latest source distribution from The Internet Systems Consortium Website. The easiest way to get the source distribution onto your Linux server is by using wget but alternately you may prefer to download the source elsewhere and FTP it to your server or copy it to disk or USB drive. Once you have the source distribution you should unpack it using tar and gzip into a directory on your Linux server so that you can start working with it. BIND must be installed as root but you can compile it as an ordinary user. This is what the process of downloading, unpacking and installing BIND looked like on our Slackware Linux server. Please note that the $ and # simply indicate that there is a prompt and what type of prompt it is, they should not be typed in.First it is wise to create a working directory for the source code, I like to compile things in my home directory on my own user account and su to root for the installation.
Next we must download the source distribution for the DNS server onto our Linux server. I usually secure shell into my Linux servers using Putty from a Windows computer and this can make it very easy to download the source. Locate the link to download BIND source code on the ISC website but instead of left clicking on it to download it to your Windows computer right click on it and select copy shortcut. Go to your Putty terminal, type wget and a space then right click to paste the copied shortcut into the terminal. Press enter and you are downloading the source directly to your Linux server! Too easy?
Named.conf for a Caching NameserverA caching nameserver is a DNS server that performs lookups on behalf of client computers and stores the results in a cache. This can result in faster lookup times and less DNS traffic if there are a reasonable number of computers using the nameserver that have a tendency to go to the same sites. The example named.conf file below is commonly found on BIND installations that come with your Linux distribution and its purpose is to provide a basic caching nameserver. As configuring a caching nameserver is documented elsewhere in this section we shall focus on making it work rather than what everything does.Starting by creating your /etc/named.conf file as shown below.
The Root Cache and Basic Zone filesThe named.conf file above specifies /var/named as the DNS servers working directory. We must make sure it exists and create it if it doesnt. Change to the /var/named directory once you have created it.
Any DNS server that performs recursive DNS lookups must be aware of the location of the parent nameservers. This is provided by a file that contains the parent nameservers names and IP addresses that is usually called named.root, named.cache or root.zone. Download this file as described in How and Where to Download a New named.root and make sure it is present in /var/named with the filename as named.root as specified in our named.conf. There are two other files specified in our named.conf and they must be present for your nameserver to be working 100% as it should. These two files are present to allow clients of the DNS server to resolve their loopback address. Your Linux server needs to be able to do that too so this is generally considered to be a necessity, regardless of the final configuration of your DNS server. named.local looks like this-
localhost.zone looks like this-
You should now be able to start your nameserver simply by typing named at the command prompt. The nameserver will start using the configuration we have just created. You can check for any errors by typing tail -f /var/log/messages. Test your nameserver using the dig command-
|
| © 2009 www.linuxserverhowto.com |