Google Plus

Install and confgure DNS For RHEL/Centos/Fedora

Written by Mel Kham on . Posted in Unix Tutorials

Build DNS server which resolves domain name or IP address. Install bind and caching-nameserver for it. And it’s also neccessary to configure router so that TCP and UDP packets to 53 can pass through.

[root@ns ~]# yum -y install bind caching-nameserver
Installed: bind.i386 30:9.3.3-8.el5 caching-nameserver.i386 30:9.3.3-8.el5
Complete!

Configure  BIND

Here is an example to configure BIND with named.conf.
This example is done with grobal IP address [172.16.0.80/29], Private IP address [192.168.0.0/24], Domain name [unixmen.net]. However, Please use your own IPs and domain name when you set config on your server. ( Actually, [172.16.0.80/29] is for private IP address, though. )

===============================================================

[root@unixmen.net ~]#  vi /etc/named.conf

options {

directory “/var/named”;

/*

* If there is a firewall between you and nameservers you want

* to talk to, you might need to uncomment the query-source

* directive below. Previous versions of BIND always asked

* questions using port 53, but BIND 8.1 uses an unprivileged

* port by default.

*/

// query-source address * port 53;

allow-query { localhost; 192.168.0.0/24; };
// query range

allow-transfer { localhost; 192.168.0.0/24; };
// transfer range

allow-recursion { localhost; 192.168.0.0/24; };
// recursion range

};
controls {

inet 127.0.0.1 allow { localhost; } keys { rndckey; };

};

// here is the section for internal informations

view “internal” {

match-clients {

localhost;

192.168.0.0/24;

};

zone “.” IN {

type hint;

file “named.ca”;

};

zone “unixmen.net” IN {

type master;

file “unixmen.net.lan”;

allow-update { none; };

};

zone “0.168.192.in-addr.arpa” IN {

type master;

file “0.168.192.db”;

allow-update { none; };

};

zone “localdomain” IN {

type master;

file “localdomain.zone”;

allow-update { none; };

};

zone “localhost” IN {

type master;

file “localhost.zone”;

allow-update { none; };

};

zone “0.0.127.in-addr.arpa” IN {

type master;

file “named.local”;

allow-update { none; };

};

zone “255.in-addr.arpa” IN {

type master;

file “named.broadcast”;

allow-update { none; };

};

zone “0.in-addr.arpa” IN {

type master;

file “named.zero”;

allow-update { none; };

};

};

// here is the section for external informations

view “external” {

match-clients {

any;

};

zone “.” IN {

type hint;

file “named.ca”;

};

zone “unixmen.net” IN {

type master;

file “unixmen.net.wan”;

allow-update { none; };

};

zone “80.0.16.172.in-addr.arpa” IN {

type master;

file “80.0.16.172.db”;

allow-update { none; };

};

};
include “/etc/rndc.key”;

// *note: For How to write for reverse resolving, Write network address reversely like below.

the case for 192.168.0.0/24
network address    ⇒ 192.168.0.0
range of network    ⇒ 192.168.0.0 – 192.168.0.255
how to write    ⇒ 0.168.192.in-addr.arpa

case of 172.16.0.80/29
network address    ⇒ 172.16.0.80
range of network    ⇒ 172.16.0.80 – 172.16.0.87
how to write   ⇒ 80.0.16.172.in-addr.arpa

====================================================
Source: serverworld sharing  knowlege

{loadposition user9}

Related Articles By Tags :

{loadposition user1}

For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

Blawer

|

Thanks!!!!!!!!!!!!!!!!!! you rules!!! all the other “help” in google are useless… yours was very helpful. Thanks again

piCool

|

Great ! we have another another master trick :-)

Yilmaz Ulugtekin

|

Just delete the space after the slash (/) it will work.

Pat L

|

I tried it and it works with a regular zip file, but if you password-protect the .zip file it does NOT work.

SK

|

Yes we can. What kind of help you need? We are doing outsourcing and technical support for Linux and Open source worldwide. To know more about the details visit here.

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .