Install DNS Server Dan Keamanannya
Written by pnyet   
                         

Ok, selanjutnya langsung pada how to instaall DNS server oya disini saya menggunakan CentOS 5.2 dan BIND 9.5P2 sebagai DNS server.

Pertama periksa apakah bind  sudha terinstall, hapus user named bila ada

# for a in $(rpm -qa | grep ^bind); do rpm -e --nodeps $a; done

# userdel -r named

Hapus direktori named

# rm -rf /var/named

Download bind, sebelumnya kunjungi link download ini dan pilih source .tar.gz

# wget http://ftp.isc.org/isc/bind9/9.5.0-P2/bind-9.5.0-P2.tar.gz

 

Ekstrak file source dari bind:

# tar -xzvf bind-9.2.2rc1.tar.gz

 

Masuk ke direktori hasil ekstrak tadi:

# cd bind-9..5.0-P2

Kemudia konfigurasi file hasil ekstrak tersebut:

# ./configure --prefix=/usr/local/named

# make

# make install

# adduser -d /var/named -s /bin/false named

 

Kemudian masuk ke direktori user named dan download file named.root yag berisi informasi tentang root server: 

# cd /var/named

# wget http://www.internic.net/zones/named.root

Selanjutnya buat file untuk reverse PTR localhost, disini saya menggunakan vi editor [my favorite] 

# vi db.127.0.0

Isi file db.127.0.0 adalah :

 

$TTL 86400

@ IN SOA localhost. root.localhost. (

2003021500 ; serial

28800 ; refresh

14400 ; retry

3600000 ; expiry

86400 ) ; minimum


IN NS localhost.

1 IN PTR localhost.

 

 

Format serial adalah yy/mm/dd/hh


# cp db.127.0.0 db.202.123.234

 Next.... buat file yang berisi tentang zone dari localhost:


# vi db.localhost


Isi dari file db.localhost adalah :



$TTL 86400

$ORIGIN localhost.

@ IN SOA localhost. root.localhost. (

2003021500 ; serial

28800 ; refresh

14400 ; retry

3600000 ; expiry

86400 ) ; minimum


IN NS localhost.

IN A 127.0.0.1

 

 

Buat file db.bind

 

 $TTL    1D
$ORIGIN bind.
@       1D      CHAOS   SOA     localhost. root.localhost. (
                2008102100      ; serial
                3H              ; refresh
                1H              ; retry
                1W              ; expiry
                1D )            ; minimum
        CHAOS NS        localhost.

version.bind. CHAOS TXT "BIND 9.1.3+robhacks"
authors.bind. CHAOS TXT "are better coders than I.:)"

 

Buat sebuah deirktori untuk menyimpan file konfigurasi dari demon program BIND:

# mkdir /usr/local/named/etc

 

Buat file /usr/local/named/etc/named.conf yang akan dijadikan sebagai file konfigurasi dari program BIND, dibawah ini saya contohkan file named.conf yang saya gunakan. Ini berdasarkan dari beberapa referensi yang saya temukan di internet:

# vi /usr/local/named/etc/named.conf

Isi dari file named.conf:


acl "xfer" {
202.123.234.100/32; // secondary name server
};

acl "trusted" {
// Masukan ip yang diijinkan melakukan recursive query
// tambah sesuai kebutuhan

202.123.234.0/24; //Example
192.168.0.0/24; //LAN
localhost; //Server ini
};

acl "bogon" {
// Hapus atau comment LAN anda dari acl bogon ini

0.0.0.0/8;
1.0.0.0/8;
2.0.0.0/8;
5.0.0.0/8;
7.0.0.0/8;
10.0.0.0/8;
23.0.0.0/8;
27.0.0.0/8;
31.0.0.0/8;
36.0.0.0/8;
37.0.0.0/8;
39.0.0.0/8;
42.0.0.0/8;
49.0.0.0/8;
50.0.0.0/8;
77.0.0.0/8;
78.0.0.0/8;
79.0.0.0/8;
92.0.0.0/8;
93.0.0.0/8;
94.0.0.0/8;
95.0.0.0/8;
96.0.0.0/8;
97.0.0.0/8;
98.0.0.0/8;
99.0.0.0/8;
100.0.0.0/8;
101.0.0.0/8;
102.0.0.0/8;
103.0.0.0/8;
104.0.0.0/8;
105.0.0.0/8;
106.0.0.0/8;
107.0.0.0/8;
108.0.0.0/8;
109.0.0.0/8;
110.0.0.0/8;
111.0.0.0/8;
112.0.0.0/8;
113.0.0.0/8;
114.0.0.0/8;
115.0.0.0/8;
116.0.0.0/8;
117.0.0.0/8;
118.0.0.0/8;
119.0.0.0/8;
120.0.0.0/8;
169.254.0.0/16;
172.16.0.0/12;
173.0.0.0/8;
174.0.0.0/8;
175.0.0.0/8;
176.0.0.0/8;
177.0.0.0/8;
178.0.0.0/8;
179.0.0.0/8;
180.0.0.0/8;
181.0.0.0/8;
182.0.0.0/8;
183.0.0.0/8;
184.0.0.0/8;
185.0.0.0/8;
186.0.0.0/8;
187.0.0.0/8;
192.0.2.0/24;
// LAN saya 192.168.0.0/16;
197.0.0.0/8;
223.0.0.0/8;
224.0.0.0/3;
};

logging {
category lame-servers { null; };
category edns-disabled { null; };
channel default_syslog {
syslog local2;
severity debug;
};

channel audit_log {
file "named_audit.log";
severity debug;
print-time yes;
};
category default { default_syslog; };
category general { default_syslog; };
category security { audit_log; default_syslog; };
        category config { default_syslog; };
category resolver { audit_log; };
category xfer-in { audit_log; };
category xfer-out { audit_log; };
category notify { audit_log; };
category client { audit_log; };
category network { audit_log; };
category update { audit_log; };
category queries { audit_log; };
category lame-servers { audit_log; };
};

options {
directory "/var/named";
allow-transfer { "xfer"; };
pid-file "named.pid";
statistics-file "named.stats";
memstatistics-file "named.memstats";
dump-file "named.dump";
zone-statistics yes;
notify no;
transfer-format many-answers;
max-transfer-time-in 60;
interface-interval 0;
allow-query { trusted; };
blackhole { bogon; };
};

view "internal-in" in {
match-clients { trusted; };
recursion yes;
additional-from-auth yes;
additional-from-cache yes;

zone "." in {
type hint;
file "named.root";
};

zone "0.0.127.in-addr.arpa" in {
type master;
file "db.127.0.0";
allow-query { any; };
allow-transfer { none; };
};

//Tambahkan domain lokal diarea ini
};
view "external-in" in {
match-clients { any; };
recursion no;
additional-from-auth no;
additional-from-cache no;

zone "." IN {
type hint;
file "named.root";
};

zone "localhost" IN {
type master;
file "db.localhost";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "db.127.0.0";
allow-update { none; };
};

zone "234.123.202.in-addr.arpa" IN {
type master;
file "db.202.123.234";
allow-query { any; };
};
};
view "external-chaos" chaos {
match-clients { any; };
recursion no;

zone "." {
type hint;
file "/dev/null";
};

zone "bind" {
type master;
file "db.bind";
allow-query { trusted; };
allow-transfer { none;};
};
};

key "rndc-key" {
algorithm hmac-md5;
secret "vukamQmCQ9m21eQx/kChqg==";
};

controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
#End of named.conf
 

Note:  Perhatikan tag pembuka { dan penutupnya };

 

Selanjutnya generate file konfigurasi yang akan digunakan oleh program rndc, yang perlu diingat adalah hasil dari perintah rndc-confgen tidak selalu sama, sebaiknya diperhatikan.

# /usr/local/named/sbin/rndc-confgen

Kemudian copy paste dari asil perintah diatas mulai dari ibaris "Start of rndc.conf" sampai dengan baris "End of rndc.conf" dan simpan pada direktori dan nama file "/usr/local/named/etc/rndc.conf" 

Selanjutnya copy paste lagi mulai dari baris "rndc-key" sampai pada baris paling bawah atau "#End named.conf" ke /usr/local/named/etc/named.conf dan jangan lupa menghilangkan tanda # kecuali pada "#End named.conf" karena yang ini bukan termasuk dalam script konfigurasi atau hanya bersifat menerangkan. Ok, dibawah ini adalah contoh dari langkah-langkah diatas:

Isi dari file /usr/local/named/etc/rndc.conf:

 

# Start of rndc.conf
key "rndc-key" {
    algorithm hmac-md5;
    secret "vukamQmCQ9m21eQx/kChqg==";
};

options {
    default-key "rndc-key";
    default-server 127.0.0.1;
    default-port 953;
};
# End of rndc.conf

Sedangkan pada file /usr/local/named/etc/named.conf ditambahkan:

# Use with the following in named.conf, adjusting the allow list as needed:
 key "rndc-key" {
     algorithm hmac-md5;
     secret "vukamQmCQ9m21eQx/kChqg==";
 };
 
 controls {
     inet 127.0.0.1 port 953
         allow { 127.0.0.1; } keys { "rndc-key"; };
 };
# End of named.conf

 

Next....

# /usr/local/named/sbin/rndc-confgen > confgen.tmp

# grep -v "^#" confgen.tmp > /usr/local/named/etc/rndc.conf

#Grep "^#" confgen.tmp | sed 1.3d | sed -e "s/\#//g" | sed -e "s/END onf named.conf//g">> /usr/local/named/etc/named.conf 

# rm -rf confgen.tmp

 

Langkah selanjutnya adalan mengubah kepemilikan home direktori dari user named, kemudian menjalankan daemon dari program BIND: 

# chown -R named.named /var/named

Jalankan BIND: 

# /usr/local/named/sbin/named -u named -c /usr/local/named/etc/named.conf


Jika sukses anda bisa melihat pada file /var/log/messages kira-kira seperti berikut:


# tail -f /var/log/messages


starting BIND 9.2.2rc1 -u named -c /usr/local/named/etc/named.conf

using 1 CPU

loading configuration from '/usr/local/named/etc/named.conf'

no IPv6 interfaces found

listening on IPv4 interface lo, 127.0.0.1#53

listening on IPv4 interface eth0, 10.126.24.1#53

command channel listening on 127.0.0.1#953

zone 17.195.124.in-addr.arpa/IN: loaded serial 2003021500

zone 0.0.127.in-addr.arpa/IN: loaded serial 2003021500

zone localhost/IN: loaded serial 2003021500

running


Tambahkan perintah "/usr/local/named/sbin/named iu named -c /usr/local/named/etc/named.conf" pada rc.local

root@ns1~]# echo ./usr/local/named/sbin/named -u named -c /usr/local/named/etc/named.conf. >> /etc/rc.local

 

Kemudian set resolver agar menggunakan name server localhost:

# echo "nameserver 127.0.0.1" > /etc/resolv.conf


Testing query menggunakan name server localhost dengan perintah host :

# host 127.0.0.1

1.0.0.127.in-addr.arpa domain name pointer localhost.

# host localhost

localhost has address 127.0.0.1

Dari semua diatas dns server telah siap untuk digunakan, ingat!! Ini bukan karya pribadi saya melainkan dari beberapa sumber yang telah saya aplikasikan, adapun referensi sebagai berikut:

Note: Klo ada salah / kuran gmohon sarannya, tq
+/-
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:):grin;)8):p:roll:eek:upset:zzz:sigh:?:cry
:(:x
 
Please input the anti-spam code that you can read in the image.
+/- Comments
Add New Search RSS
Anonymouse  - error   |202.47.75.xxx |24-10-2008 09:36:48
configure: error: no acceptable C compiler found in $PATH
See `config.log' for
more details.

itu kenapa ya?
pnyet  - re: error     |202.47.75.xxx |03-11-2008 11:14:51
Anonymouse wrote:
configure: error: no acceptable C compiler found in $PATH
See `config.log'
for more details.

itu kenapa ya?


coba cek gcc nya
u/ install gcc bisa gunakan script dibawah ini:

yum -y
install gcc
Anonymous   |222.174.116.xxx |15-06-2010 12:32:53
You must have to want to buy cheap products,then you can get to our website
to buy our cheap Christian Louboutin Shoes together with the Herve Leger Dress,it can make you fashionable and charming.Meanwhile our fitness training
shoes MBT Shoes are in Hot sell,please come here and order now!In addition,our Jimmy Choo Shoes and Manolo Blahnik Shoes are the dreams of many customers.Do not forget our Vibram Five Fingers and P90X DVD,quickly to purchase them,otherwise you'll find all the good products have
been sold out!
Christian Louboutin Boots Christian Louboutin Boots Christian Louboutin Pumps Christian Louboutin Pumps Christian Louboutin Sandals Christian Louboutin Sandals Christian Louboutin ...
yuyangguoji  - lw   |222.174.116.xxx |20-07-2010 12:51:44
I firmly believe you need the Action Adventure with reasonable price that with the high quality,and we will let your
dream come true,a bloody cool boy is born with our mbt boots in the crowd.So don't hesitate,just come to our online shop to catch the
opportunity once in the blue moon,to pick up and buy our workout dvd,a wide range from mbt boots,sport shoes and wholesale mbt to p90x fitness.Of course we are sure you will not miss our fantasy cheap video.
Men MBT M.Walk shoes,cheap MBT M.Walk shoes,cheap Women MBT M.Walk shoes,cheap Men MBT M.Walk shoes,MBT Lami shoes,cheap MBT Lami shoes,MBT Lami shoes sale,MBT Lami shoes for sale,cheap MBT Lami shoes sale,MBT Sport Shoes,cheap MBT Sport Shoes,MBT Spor...
babydoll     |120.36.36.xxx |20-07-2010 14:06:54
Now lots of people buy adult *** product to improve *** life high stocking,we supply all kinds of adult *** product Long Lady Stocking,because we are manufacture and have our factory women stocking,our product are all safe and wholesale wife babydoll,welcome to visit our store pijamas,all kinds of adult *** product for female and male open bust babydoll, you will buy your love *** product from our store Strap on dildos,adult *** product will greatly improve the quality of your *** life stocking online,*** life is very important baby doll nighties,*** life is harmonious babydoll costumes,the life is happies Wholesale Long Stocking,you can introduce your family and friend to visit our store Finger vibrators,best wi...
christy  - lengthen life   |123.158.163.xxx |21-08-2010 09:13:04
the market so if you choose lengthy costume wigs hair is constructed with machine sewn lace wigs wefts human hair ponytail human hair wigs are some hints and tips on how to wigs headband wigs invisible lace wigs remy hair At Vogue Wigs human hair wigs are the lace front wigs farrah fawcett costume according to the manufacturers suggested synthetic hair wigs Signature Collection of custom full lace wigs human hair wigs wigs hair extensions Wigs come in all shapes and styles-from human hair hair wigs is sold on the full lace wigs discount lace front wigs Certainly the exotic appearance will hair extensions in recent years and are not the lace wig adhesive ever having to dye perm or bohyme hair extensions clip on hair ex...
cheap ugg boot store  - uggs outlet     |117.26.221.xxx |23-10-2010 13:57:10
One of my favorite UGG boots bands was held hostage for the better part of two years by a slick young
"He's not like uggs bailey button label guy at all," on the basis of such a deal memo. He had failed to
come through on any of his cardy ugg moss sale promises [something he did with similar effect to another well-known
band], and so the band wanted out. Another label expressed interest, but
when the A & R man was asked to release the ugg classic tall boots band, he said he would need money or points, or possibly both, before he
would consider it. The new label was afraid the price would be too
dear, and they said no thanks. On the cusp of ma...
zjcjy   |222.212.60.xxx |23-02-2011 14:10:16
nearZentai themZentai Suit Ilycra zentai didnSexy Lingerie tChemise wantbustier him***y costumes toCosplay beCosplay Wigs somewhereCosplay Costumes alonecosplay shop SheLolita Clothing wasLolita Dress silentsweet lolita dress forIpad Accessories atouch screen momentsmart phone toandroid phone collectcheap phones herselfunlocked phones Adual sim phones gentletablet pc 10inch facedTablet PC womantablet pc review inBest Tablet PCs hertablet computers midCell Phones thirtiesPhones plainlydiscount cell phone prettycell phone offers ascheap cell phone herFM5000 motherFashion Shoes haddesigner shoes beenshoes online shecheap boots lookedhigh heels allshoes uk atfashion boots onceAnkle boot inPumps Shoes noFlat Shoes waySnow Boots authoritativew...
zjcjy   |222.212.60.xxx |23-02-2011 14:11:49
thistiffany jewellery istiffany jewelry howtiffany itsilver jewelry turnscheap tiffany jewellery outtiffany and co ThereTiffany Necklace sTiffany Bracelet nothingTiffany Earrings moreTiffany rings wesilver bracelet canray ban doray ban sunglasses Dadbest ray ban sunglasses Thendiscount ray ban sunglasses sheray ban wayfarer rememberedray ban 2140 hisray ban 2132 ownCartier Glasses Frame stoicalglasses frame maximeye glasses frames fromcartier frame decadescartier spectacle frames backcartier sunglasses andcartier eyeglasses begancartier watches toed hardy cryed hardy sale Therecheap ed hardy sed hardy shirts noed hardy caps remakinged hardy accessories realityed hardy swimwear sheed hardy tank toldED Hardy Kids himed hardy suits Justed h...
zjcjy   |222.212.60.xxx |23-02-2011 14:13:04
arideray ban aray ban sunglasses bikeray ban aviator andrayban sunglass toray ban sale swimray ban polarized andray bans toMoncler playmoncler coats allmoncler jackets themoncler online sportsbuy moncler inMoncler Sweater whichMoncler Children Jacket HowieNfl Jerseys himselfnfl jersey excelledNfl Jersey Sale Itcheap nfl jerseys stillcharles woodson jersey appearedauthentic nfl jerseys asauthentic nfl jerseys cheap ifdiscount nfl jerseys hefootball nfl jerseys couldnfl shop runcheap jerseys apro bowl jerseys footballSam Bradford throughRyan Mathews theysl middleysl shoes ofgirls shoes theyves saint laurent shoes lineysl pumps andysl sandals hebrand shoes wasfashion shoes seventyevening shoes sevendesigner shoes yearswedge sandals oldblack...
zjcjy   |222.212.60.xxx |23-02-2011 14:14:11
onesRay Ban sunglasses aboutaviator sunglasses nearlyray ban wayfarer everyoneRay Ban whoRay Ban Aviator isray ban wayfarer sunglasses buriedmens designer sunglasses hereray ban sunglasses sale hemens Burberry shouldburberry bags haveburberry handbags livedcheap burberry bags longerdiscount burberry bags Heburberry coats shouldburberry ties havetiffany indeedtiffany and co Heretiffany jewelry aftertiffany jewellery atiffany bracelet momenttiffany earrings stiffany rings silencetiffany necklace thegucci sale resignedgucci bags sale lookDiscount Gucci Handbags ofGucci Bags gloomgucci handbags onGucci Hobo hisGucci Messenger Bag faceGucci Shoulder Bag gaveGucci Tote wayghd toghd straighteners aghd hair straighteners sorrowfulCheap GHD strai...
Anonymous     |60.6.208.xxx |25-02-2011 13:22:59
The fashionable handbags provided by our company feature high quality
leather, and I think that the exquisite designs of our bags will attract
your eyes.We have been in the market for selling well known handbags
for many years.The handbags on our website are the exact copies of popular
branded handbags. The material, the craftsmanship and the detailing of
our handbags is so good that it is very hard to differentiate between a
genuine fashionable handbag and the replica.Our bags are as following:
Coach handbags, Gucci handbags, Designer handbags, Prada, Yves Saint Laurent bags, Chole, Hermes, Burberry, Fendi, Gucci and Clutches Pouches . I believe that mo...
Anonymous     |60.6.208.xxx |25-02-2011 13:23:51
In modern society, women handbags develop into a necessarity for women
exterior. Handbags have played an important role in our
daily life.Amazingly replica handbags will not only protect your
precious accessories like gold jewelry, glasses, clips, replica wallets,
scarves, belt, and costumes inside them but also maintain their worth
for long time.By the way, Our replica handbags will instantly give a huge
shape to your figurines in a completely hot and lustrous manner. Bags
offered by us include: Coach handbags, Gucci handbags, Designer handbags, Prada, Yves Saint Laurent bags, Chole, Hermes, Burberry, Fendi, Gucci and Clutches Pouches. Our Replica handb...
Anonymous     |60.6.208.xxx |25-02-2011 13:24:30
Our replica watches have ultimate precision,and every detail of our replica
watches is highly mirrored the originals.these two versions
look almost the same.By the first sight, you would be impossible to
distinguish them.So they are in greater demand. Functional and precise
movements are equipped inside our replica watches of the best grade,
further assuring the high quality and excellent performance. Those replica
watches offered by us include the following :Towatchit Replica Watches, Breitling Replica Watches, Bvlgari Replica Watches, MontBlanc Replica Watches, Tag-Heuer Replica Watches, Rolex Replica Watches, Omega Replica Watches, Panerai Replica Watches, Cart...
Anonymous     |60.6.208.xxx |25-02-2011 13:25:35
Our replica watches are designed to complete your style. If you want to
know more about our watches, Please check our site, our different styles
of replica watches are as following:Emporio Armani Replica Watches, Vacheron Constantin Replica Watches, IWC Replica Watches, Luxury Pens Replica Watches, Audemars Piguet Replica Watches, Bell Ross Replica Watches, Hublot Replica Watches, Zenith Replica Watches, Zenith Elite Replica Watches, Patek Philippe Replica Watches, Franck Muller Replica Watches. It is well known that a watch is more than just expressing
yourpersonality, it also signifies your wealth, status, and choice.Such as
rolex replica watches can help you look pedantic,professional&...
Andy   |175.42.32.xxx |20-08-2011 15:34:58
Audemars Piguetcan provide the close look and character that the true matter could only at
a practically lower price. There are a lot of accompanies
that provide top character Audemars Piguet Classique Collection watcheswhich could make a content on your heart. This  watch that you are able to
like isAudemars Piguet Contemporaine Collection watchesbrand. You are able to discover well-favoured Audemars Piguet Sport Collection watchesthat will agree your daily closet for a identical low-cost . Alongside from
the popular looking that can take out of having Bume & Mercier watches, they are very tolerant for daily use too. Just same as the creativewatch Baume & Mercier CapeLand watches some replica....
Coach Outlet Online  - Coach Outlet Online     |121.158.55.xxx |16-11-2011 13:39:09
One Coach Factory Outlet of clothing

Coach Online Outlet be loose

Coach Outlet Store Online compliment the

Coach Outlet Store Online of
the [url=http://www.coachsfactory-

online.net/]Coach Factory[/url]. A
loose Coach Factory Outlet

or a skirt Coach Factory Online help the

Coach Outlet Online Bags flow

Coach Factory Outlet what you

Coach Store Online wearing. Small

Coach Factory Store Online with a

Coach Outlet Online strap are

Coach Outlet Store to be matched

Coach Factory Store a sun dress

Coach Online Outlet Store jeans with

Coach Outlet snug top. Coach

Outlet Online
type of Coach Outlet Online is the

Coach Factory to wear

Coach Outlet Store Online is usually

Coach Factory Outlet ...

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."