[How To] Configure DNS Server in Linux

by freak on February 26, 2010

As I always have been doing, this article is basically for Ubuntu. I will be using my Ubuntu machine with Ubuntu Lucid Lynx 10.04 Alpha 2 machine.

So here is the article. Enjoy fellas. ;)

1) Install bin9 and dnsutils
apt-get install bind9 dnsutils

2) Configure bind
gksu gedit /etc/bind/named.conf.local

Now add a zone
Example:

zone "Youdomain"{
type master;
file "/etc/bind/zones/yourdomain.db";
};

My ip address is 192.168.0.1 and netmask 255.255.255.0. So in the my domain I use a reverse notation of my network address(192.168.0), 0.168.192 and my configuration file looked like:

zone "0.168.192.in-addr.arpa"{
type master;
file "/etc/bind/zones/0.168.192.in-addr.arpa.db";
};

3) Now you’ll need to point your one level up dns server. Be careful while selecting this. You may like to configure the dns that is regularly updated not like Wlink :P To do so you show edit the file named.conf.options and change the forwarder to the dns server your DNS server will point :D Quite confusing?
gksu gedit /etc/bind/named.conf.options

And place the code:

forwarders {
# Replace the address below with the address of your provider’s DNS server
208.67.222.222 # I'm using openDNS(My fav) ;)
};

4) Now make a directory zones in /etc/bind/
gksu mkdir /etc/bind/zones

5) Edit the zone file stated in named.conf.local
gksu gedit /etc/bind/zones/0.168.192.in-addr.arpa.db

My configuration looked like:

// replace 0.168.192.in-addr.arpa with your domain name. do not forget the . after the domain name!
// Also, replace ns1 with the name of your DNS server
0.168.192.in-addr.arpa. IN SOA ns1.0.168.192.in-addr.arpa. admin.0.168.192.in-addr.arpa. (
// Do not modify the following lines!
2007031001
28800
3600
604800
38400
)
// Replace the following line as necessary:
// ns1 = DNS Server name
// mail = mail server name
// 0.168.192.in-addr.arpa = domain name
0.168.192.in-addr.arpa. IN NS ns1.0.168.192.in-addr.arpa.
0.168.192.in-addr.arpa. IN MX 10 mail.0.168.192.in-addr.arpa.
// Replace the IP address with the right IP addresses.
www IN A 192.168.0.1
mta IN A 192.168.0.1
ns1 IN A 192.168.0.1

6) Restart bind.
In the terminal:
sudo /etc/init.d/bind9 restart

7) The final step is to check if the configured dns server is working correctly or not
gksu gedit /etc/resolv.conf

Change the nameserver to your nameserver mine is 192.168.0.1

Now in the terminal type
dig google.com

And check if your dns server was configured correctly or not?

Mine did. ;)

Enjoy fellas.

{ 0 comments }

[How To] Change Wordpress Password from Database

February 5, 2010

Forgot your self hosted wordpress password? Did your wordpress blog got hacked? Or just want to play around with wordpress?
Here is a tutorial how to reset your wordpress password using phpmyadmin from your cPanel.

Read the full article →

[How To] Create gantt chart in Ubuntu

December 12, 2009

Dear reader, I fr3ak, am back with yet another freakingtips among you. This time I’m going to share with you how I solved my project management requirement in Ubuntu. As you all know that I am using Ubuntu 9.10 Karmic Koala this will be for Karmic Koala but it is guaranteed to work on other [...]

Read the full article →

[Solved]Native Library bluecove not available Ubuntu 9.10(Karmic Koala)

December 11, 2009

Recently my friend was doing his minor project. His project was related to bluetooth and was using bluecove for the server side i.e. computer. He used netbeans as his IDE. The program was built well without any error but he faced problem running the program. I then searched the internet and got no help.

Read the full article →

FaceBookAgent Scam or Not [YES]

December 3, 2009

Recents my friend looked at the hottest trends in google search and found “facebookagent” within top 20 search queries. We then went to this website and downloaded a software which guaranteed to
Get a fast, free way to see private facebook profiles

Read the full article →

[HOW TO] Recover deleted files and corrupt harddisk in Ubuntu

December 3, 2009

Few days ago, a friend of mine complained that his Windows declared a drive as damaged and asked to format it each time. He went to market and asked an expert if the files can be recovered. The expert said that he would recover the file but it would cost him NRs. 2000. So, thinking [...]

Read the full article →

[HOW TO]Copy crack protected PDF’s in Ubuntu

December 3, 2009

After a long waited time, I’m back with another freaking tips related to Linux. As I have Ubuntu 9.10 (Karmic Koala) installed in my machine, I will be teaching the method for Ubuntu only. However, the similiar syntax can help in other version of Linux OSes.
First of all we are going to need a locked(copy [...]

Read the full article →

Ubuntu Karmic Koala Sound Problem [Solved]

September 3, 2009

Today while I was listening to music in my Ubuntu(Karmic Koala Alpha 4) machine, the sound suddenly stopped. I searched over the internet and found no solution to the problem. I restarted my alsa utilities but no luck. Then I killed the pulseaudio and then the sound started to play again.

Read the full article →

Save Online Streaming Video

August 24, 2009

Recently my brother asked me to saved online streaming video of Sagarmata FM. I tried VLC for recording the streaming video but had no luck. So I thought that the video can be dumped some command line tools like mplayer. I download the latest version of mplayer in the repo.

Read the full article →

Installing Code::Blocks in Debian(Lenny)

August 8, 2009

I had to recently switch to Debian(Lenny) as my System Admin switched from Ubuntu to Debian. Being a engineering student, I have to code in C/C++ and I’m not that acquanted with commandline compilation. I hate that “gcc” and blah…blah thing(when had to type that). I am familiar with the famous IDE Code::Blocks and have [...]

Read the full article →