User loginZoho |
Ubuntu DNS Server Guide - BIND Caching Name Server SetupIn previous posts, I shared instructions for setting up a Ubuntu LAMP (Linux, Apache, mySQL, PHP) server and configuring Apache and mySQL
to host new sites complete with phpmyadmin and cgi-bin access. I
thought it would be useful to write a follow-up guide on setting up of
an Ubuntu DNS (Domain Name Service) server on your LAN (local area
network). For newcomers, DNS is a service that maps IP addresses to
domain names (e.g., a public DNS server is responsible for mapping
www.google.com to 74.125.19.103
and vise versa). There are several reasons why you may want to set up a
private DNS server on you LAN. If your LAN includes more than a few
machines, a private DNS server may be a more convenient way to map
client host names to IP addresses then having to maintain a hosts
configuration files on each client. A private DNS server can also help
increase network performance by caching IP addresses of commonly
visited websites instead of retrieving them from the public DNS servers
maintained by ISPs at each request. This post describes how to set up a
caching DNS server using BIND9 (Berkley Internet Naming Daemon Version
9), the most widely used DNS program and the DNS server that ships with
Ubuntu. In a follow-up post I describe how to set up a master DNS server to serve DNS records for an imaginary domain (i.e., your LAN).
Step 1: Install BIND DNS server on Ubuntu
There are two ways to install BIND on Ubuntu. If you are performing
a fresh installation of Ubuntu Server Edition (version 7.04 at time of
writing),
at some point the install shell will ask if you wish to install a DNS
and/or LAMP server. Select DNS (and LAMP if you so desire using the
arrow keys and spacebar) and continue (using tab and enter). On the
other hand, if you have already completed the installation of your LAMP
server then use Ubuntu’s built in package management program
sudo aptitude update
sudo aptitude install bind9 You may need to insert the Ubuntu install CD to perform this installation.
Step 2: Configure BIND Caching DNS server
By default, BIND installs on Ubuntu configured to act as a caching
DNS server. However, you need to edit the configuration options file
sudo vi /etc/bind/named.conf.options
Uncomment and edit the
forwarders {
xxx.xxx.xxx.xxx; xxx.xxx.xxx.xxx; };
You must also edit the
vi /etc/resolv.conf
and add
nameserver xxx.xxx.xxx.xxx
to the top of the file where
sudo /etc/init.d/bind9 restart
Finally, test your server by typing the following command in a terminal on any machine on your LAN configured to use your new DNS server.
dig www.zaphu.com
Near the end of the output of this command there should be a line that reads
sudo rndc -s localhost flush
or set the maximum amount of memory to use (in essence forcing overflow data to be deleted before it expires) by setting the |
Vmware AppliancesExpert VillageTechnologyLinuxRecent FAQs |