7 Easy Steps Installation DNS server in Ubuntu Jaunty September 22nd, 2010
DNS (Domain Name Service) server is a server that translate an IP address into a name that will be easy to remember or do the opposite way.
The administrative job is done in Server side. For client side just set the machine to connect the DNS server.
Before we start, I assume that you are connected to Internet already. For, text editor, you can use any program that you are familiar with. In this sample, I use vim.
The installation is as easy as below:
Step 1. Install the bind9
Open Linux Terminal (Applications>Accessories>Terminal), type: sudo apt-get install bind9
Installation finished.

Read the rest of this entry »
Posted in debian, linux, Networking, ubuntu | No Comments »
How-To: Setting up a DNS zone with Bind9 July 1st, 2009
Bind is a well known Unix name server, it is a powerfull piece of software which is used by the majority of nameservers.
This article will go though setting up a local area network that can be used at home or inside a small company.
In this article, we suppose that we are going to set a DNS zone for the domain: debuntu.foo, this is a fictionnal zone which is going to be used as a local network domain such as an intranet.
The name server is not accessible from the outside and only has 1 private LAN adress network interface.
All other computer in the LAN are going to use 192.168.1.5 as a nameserver, this can be set manually by setting statically:
nameserver 192.168.1.5
in their /etc/resolv.conf files, or via a DHCP server (beyond the scope of this article).
In the end, the nameserver is going to provide name resolution as well as reverse name resolution for our local network. For the rest of the domain name, it will query other DNS server and cache the result, behaving as a resolving, caching name server.
In the first part we are going to deal with name resolution and then in the second part, we are going to set up the reverse name resolution.
Requirements:
This how-to has been made using bind9, first of all, you need to install this package:
sudo apt-get install bind9
Now, we are going to set up debuntu.foo domain name.
Setting up Domain name resolution:
edit the local configuration file:
sudo vi /etc/bind/named.conf.local
and at the following entry:
zone “debuntu.foo” {
type master;
file “debuntu.foo.db”;
notify no;
};
As I don’t use any slave server in that example, I turn the value of notify to no.
What we say here, is that we are the master server for debuntu.foo, and the configuration file of that zone will be located at: /var/cache/bind/debuntu.foo.db.
Notice: the directory value (/var/cache/bind/) might vary depending on your distribution. Check its value in /etc/bind/named.conf.options .On a Ubuntu Dapper, the default value is:
options {
directory “/var/cache/bind”;
….
….
Now, we are going to fill up the required values to define the domain debuntu.foo.
Create and edit /var/cache/bind/debuntu.foo.db, and add:
;
; Zone file for debuntu.foo
;
; The full zone file
;
$TTL 3D
@Â Â Â Â Â Â INÂ Â Â Â Â SOAÂ Â Â Â ns.debuntu.foo. chantra.debuntu.foo. (
200608081Â Â Â Â Â Â ; serial, todays date + todays serial #
8HÂ Â Â Â Â Â Â Â Â Â Â Â Â ; refresh, seconds
2HÂ Â Â Â Â Â Â Â Â Â Â Â Â ; retry, seconds
4WÂ Â Â Â Â Â Â Â Â Â Â Â Â ; expire, seconds
1D )Â Â Â Â Â Â Â Â Â Â Â ; minimum, seconds
;
NS     ns             ; Inet Address of name server
MX     10 mail        ; Primary Mail Exchanger
MXÂ Â Â Â Â 20 mail2Â Â Â Â Â Â Â ; Secondary Mail Exchanger
;
ns             A      192.168.1.5
www            CNAME  www.debuntu.org.
ftp            CNAME  ns
gw             A      192.168.1.1
TXTÂ Â Â Â “Network gateway”
mail           A      192.168.1.2
mail2Â Â Â Â Â Â Â Â Â Â CNAMEÂ Â otherbox
otherbox        A     192.168.1.3
TXTÂ Â Â Â “Otherbox”
In this file, we define:
- the adress of the name server; 192.168.1.5,
- an alias from www.debuntu.foo to www.debuntu.org,
(mind the dot “.” at the end of an external name), - another alias from ftp.debuntu.foo to ns.debuntu.foo,
- An adresse for the local network gateway with a description
- …
From now on, any machine from your local network, using this name server, will be able to access the others using the domain names we defined above instead of IP adresses.
Setting up Reverse Name Resolution:
In order to be able to get the name of the machine located at IP 192.168.1.X, we need to set up a reverse name zone which is going to be call, in this example 1.168.192.in-addr.arpa,
edit /etc/bind/named.conf.local and add:
zone “1.168.192.in-addr.arpa” {
type master;
notify no;
file “reverse/192.168.1″;
};
This time, wa are going to write the information for reverse dns in a specific directory (“reverse”). Create that directory and edit the zone file:
mkdir /var/cache/bind/reverse
vi /var/cache/bind/reverse/192.168.1
and copy the following lines:
$TTL 3D
@Â Â Â Â Â Â INÂ Â Â Â Â SOAÂ Â Â Â ns.debuntu.foo. chantra.debuntu.foo (
200608051 ; Serial, todays date + todays serial
8HÂ Â Â Â Â ; Refresh
2HÂ Â Â Â Â ; Retry
4WÂ Â Â Â Â ; Expire
1D)Â Â Â Â ; Minimum TTL
NSÂ Â Â Â Â ns.debuntu.foo1Â Â Â Â Â Â Â Â Â Â Â Â Â Â PTRÂ Â Â Â gw.debuntu.foo.
2Â Â Â Â Â Â Â Â Â Â Â Â Â Â PTRÂ Â Â Â mail.debuntu.foo.
3Â Â Â Â Â Â Â Â Â Â Â Â Â Â PTRÂ Â Â Â otherbox.debuntu.foo.
5Â Â Â Â Â Â Â Â Â Â Â Â Â Â PTRÂ Â Â Â ns.debuntu.foo.
now, doing a nslookup on 192.168.1.2 will return mail.debuntu.foo.
Thanks to Author, orignal link http://www.debuntu.org/2006/08/05/85-how-to-setting-up-a-dns-zone-with-bind9
Posted in debian, linux, Networking, ubuntu | No Comments »


