Configure DNS Server on CentOS 5.3

By admin

Check if dns already installed

# rpm -qa | grep bind

bind-libs-9.3.4-10.P1.el5
ypbind-1.19-11.el5
bind-chroot-9.3.4-10.P1.el5
bind-9.3.4-10.P1.el5
bind-utils-9.3.4-10.P1.el5
[root@mail ~]#

Great, its installed.

Starting bind

# /etc/init.d/named start

Locating /var/named/chroot//etc/named.conf failed:
[FAILED]

Ok, time to configure.

Remove

# yum remove dnsmasq

# yum remove bind-chroot-9.3.4-10.P1.el5

# yum remove bind-9.3.4-10.P1.el

Install

# yum install bind

# nano /etc/named.conf

Put these lines :

options {

directory    “/var/named”;

query-source port 53;

allow-transfer {

localhost;

};

};

zone “digitalfusi.com” {

type master;

file “digitalfusi.com.db”;

};

zone “localhost” {

type master;

file “localhost.db”;

};

zone “0.0.127.in-addr.arpa” {

type master;

file “127.0.0.rev”;

};

zone “.” in {

type hint;

file “root.db”;

};

# nano /var/named/digitalfusi.com.db

$TTL 2d ; 172800 seconds

$ORIGIN digitalfusi.com.

@        IN      SOA    digitalfusi.com. hostmaster.digitalfusi.com. (

2008051200 ; serial number (change when you modify DNS)

1d12h      ; refresh =  1 day 12 hours

15M        ; update retry = 15 minutes

3W12h      ; expiry = 3 weeks + 12 hours

2h20M )    ; minimum = 2 hours + 20 minutes

@        IN     NS      ns1.digitalfusi.com.

@        IN     A       192.168.12.105

ns1      IN     A       192.168.12.105

www      IN     A       192.168.12.105

mail     IN     A       192.168.12.105

mail2    IN     A       192.168.12.105

postfixadmin   IN    A    192.168.12.105

mailguard   IN    A      192.168.12.105

# nano /var/named/localhost.db

$TTL 2d

$ORIGIN localhost.

@      IN  SOA  localhost. hostmaster.localhost. (

2008051101 ; serial number (change when you modify DNS)

1d12h      ; refresh =  1 day 12 hours

15M        ; update retry = 15 minutes

3W12h      ; expiry = 3 weeks + 12 hours

2h20M )    ; minimum = 2 hours + 20 minutes

@      IN  NS localhost.

@      IN  A  127.0.0.1

# nano /var/named/127.0.0.rev

$TTL 2d

$ORIGIN 0.0.127.in-addr.arpa.

@        IN SOA localhost. hostmaster.localhost. (

2008051101 ; serial number (change when you modify DNS)

1d12h      ; refresh =  1 day 12 hours

15M        ; update retry = 15 minutes

3W12h      ; expiry = 3 weeks + 12 hours

2h20M )    ; minimum = 2 hours + 20 minutes

@        IN NS   localhost.

1        IN PTR  localhost.

# nano /var/named/root.db

; This file holds the information on root name servers needed to

; initialize cache of Internet domain name servers

; (e.g. reference this file in the “cache . <file>”

; configuration file of BIND domain name servers).

;

; This file is made available by InterNIC

; under anonymous FTP as

; file /domain/named.root

; on server FTP.INTERNIC.NET

; -OR- RS.INTERNIC.NET

;

; last update: Feb 04, 2008

; related version of root zone: 2008020400

;

; formerly NS.INTERNIC.NET

;

. 3600000 IN NS A.ROOT-SERVERS.NET.

A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4

A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30

;

; formerly NS1.ISI.EDU

;

. 3600000 NS B.ROOT-SERVERS.NET.

B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201

;

; formerly C.PSI.NET

;

. 3600000 NS C.ROOT-SERVERS.NET.

C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12

;

; formerly TERP.UMD.EDU

;

. 3600000 NS D.ROOT-SERVERS.NET.

D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90

;

; formerly NS.NASA.GOV

;

. 3600000 NS E.ROOT-SERVERS.NET.

E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10

;

; formerly NS.ISC.ORG

;

. 3600000 NS F.ROOT-SERVERS.NET.

F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241

F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2f::f

;

; formerly NS.NIC.DDN.MIL

;

. 3600000 NS G.ROOT-SERVERS.NET.

G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4

;

; formerly AOS.ARL.ARMY.MIL

;

. 3600000 NS H.ROOT-SERVERS.NET.

H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53

H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803f:235

;

; formerly NIC.NORDU.NET

;

. 3600000 NS I.ROOT-SERVERS.NET.

I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17

;

; operated by VeriSign, Inc.

;

. 3600000 NS J.ROOT-SERVERS.NET.

J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30

J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30

;

; operated by RIPE NCC

;

. 3600000 NS K.ROOT-SERVERS.NET.

K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129

K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fd::1

;

; operated by ICANN

;

. 3600000 NS L.ROOT-SERVERS.NET.

L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42

;

; operated by WIDE

;

. 3600000 NS M.ROOT-SERVERS.NET.

M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33

M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35

; End of File


Testing start dns

# /etc/init.d/named start

Starting named:                                            [  OK  ]

Activate dns server in /etc/resolv.conf into like this

search digitalfusi.com
nameserver 192.168.12.105
nameserver 192.168.12.1

Try if dns work

# dig digitalfusi.com

; <<>> DiG 9.3.4-P1 <<>> digitalfusi.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39096
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;digitalfusi.com.               IN      A

;; ANSWER SECTION:
digitalfusi.com.        172800  IN      A       192.168.12.105

;; AUTHORITY SECTION:
digitalfusi.com.        172800  IN      NS      ns1.digitalfusi.com.

;; ADDITIONAL SECTION:
ns1.digitalfusi.com.    172800  IN      A       192.168.12.105

;; Query time: 10 msec
;; SERVER: 192.168.12.105#53(192.168.12.105)
;; WHEN: Mon May  4 20:07:52 2009
;; MSG SIZE  rcvd: 83

Yes, it work for resolve dns and serve dns.

Incoming search terms for the article:

Information

Quick and Easy Way to Install FreeBSD Email Server from Scratch , covered virtual hosting and multiple domain, spam protection etc plus tips to get system up to date

  • Pages

  • Download Ubuntu

  • Download Fedora

  • Tags

    atmail open on ubuntu server change ip address check connection clamav continue install dns dovecot fuzzyocr install jaunty maia mailguard mysql New Virtual Disk Wizard nginx pear php postfix postfixadmin preparation roundcube mail Setting Virtual Machine spamassassin squirrelmail
  • Categories

    • Translate to: