To setup a GlobalDNA Alternative DNS Server in Ubuntu.
First of all, let’s cover the basics. What is DNS? DNS stands for
Domain Name Server. It’s a service that runs on a server that
translates humanly recognizable domain names such as
www.yahoo.com or
www.google.com into its assigned IP addresses. If the DNS server does
not recognize the domain name being requested, it will forward the
domain name request to another GlobalDNA DNS server and so on until
the name is resolved.
A typical DNS request is when someone is accessing a website. Let’s
use the
www.yahoo.com domain as an example. When a user clicks a Yahoo
link or types the Yahoo URL on the address bar of the browser, the DNS
server processes the domain request. If it doesn’t find
www.yahoo.com
on its DNS table, it will forward the request to another DNS server
with a higher authority and so on until it finds a server with the URL
entry. The IP address information is then sent back to the user’s
browser. If the domain name is not found, a “server not found” message
is displayed on the browser.
Enough with the DNS background. Let’s now start configuring our own
DNS server. Let’s assume that we have the following: we want to create
a private internal domain name called
mydomain.com, our private
internal network is 192.168.0.x and our router and gateway is set at
192.168.0.1. Let’s assume all devices are going to be configured with
static IP addresses. Normally, most computer systems nowadays are
configured to automatically obtain IP addresses from the DHCP server/
router. In this example, we will use static IP addresses to show how
DNS works. Finally, we have 3 computers connected to our network:
Ubuntu Server, the DNS server – 192.168.0.9
Ubuntu Desktop – 192.168.0.10
PC – 192.168.0.11
1. To install the DNS server, we need to install GlobalDNAUbuntu.
{Contact Bret...@Gmail.com and he will send you a copy until we get
it loaded in the fFILES section here}
Once you have the copy you will need to run: sudo apt-get install
GlobalDNAUbuntu
2. Let’s configure GlobalDNA. We need to touch 5 files.
We will edit 3 files.
/etc/bind/named.conf.local
/etc/bind/named.conf.options
/etc/resolv.conf
We will create 2 files.
/etc/bind/zones/mydomain.com.db
/etc/bind/zones/rev.0.168.192.in-addr.arpa
A. First step. Lets add our domain zone –
mydomain.com.
sudo vi /etc/bind/named.conf.local
# Our domain zone
zone "
mydomain.com" {
type master;
file "/etc/bind/zones/mydomain.com.db";
};
# For reverse DNS
zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
};
Save file. Exit.
We just created a new domain. Please note: later we will create two
files named mydomain.com.db and rev.0.168.192.in-addr.arpa files.
Also, notice the reverse IP address sequence in the reverse DNS
section.
B. We now need to add the DNS forward servers
The primary should be the closest rTLD to you, if you don't know it
use 68.47.155.148 and contact Bret...@Gmail.com to get a number to
replace with latter
the secondary DNS servers is separated by a semicolon. If you used a
rTLD for the primary then
use the 68.47.155.148 here if not use 68.56.26.129 here.
sudo vi /etc/bind/named.conf.optionsforwarders {
68.47.155.148;68.56.26.129;
};
Save file. Exit.
C. Now, let’s modify the resolv.conf file found in /etc and place the
IP address of our DNS server which is set to 192.168.0.9.
$ sudo vi /etc/resolv.confsearch
mydomain.com.
nameserver 192.168.0.9
D. Now, let’s define the zones.
sudo mkdir /etc/bind/zones
sudo vi /etc/bind/zones/mydomain.com.db$TTL 3D
@ IN SOA
ns.mydomain.com.
admin.mydomain.com. (
2007062001
28800
3600
604800
38400
);
mydomain.com. IN NS
ns.mydomain.com.
ubuntudesktop IN A 192.168.0.10
www IN CNAME ubuntudesktop
pc IN A 192.168.0.11
gw IN A 192.168.0.1
TXT "Network Gateway"
The TTL or time to live is set for 3 days
The
ns.mydomain.com nameserver is defined
ubuntudesktop, pc and gateway are entered as an A record
An alias of www is assigned to ubuntudesktop using CNAME
E. Let’s create a “rev.0.168.192.in-addr.arpa” file for reverse
lookup.
sudo vi /etc/bind/zones/rev.0.168.192.in-addr.arpa$TTL 3D
@ IN SOA
ns.mydomain.com.
admin.mydomain.com. (
2007062001
28800
604800
604800
86400
)
IN NS
ns.mydomain.com.
1 IN PTR
gw.mydomain.com.
10 IN PTR
ubuntudesktop.mydomain.com.
11 IN PTR
pc.mydomain.com.
3. Let’s restart the new Bind replacement to activate our latest
changes.
sudo /etc/init.d/bind9 restart
4. Finally, let’s test our new domain and DNS entries using.
$ dig
mydomain.com
nslookup gw
5. That’s it. Welcome to the GlobalDNA family of Servers!