LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 10-29-2010, 07:08 AM   #1
redh
LQ Newbie
 
Registered: Oct 2010
Posts: 5

Rep: Reputation: 0
Question CentOS Server - How to configure DNS


Hi everyone..

i am using CentOS 5.5 trying to install DNS

options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/fnamed_stats.txt";
/*
* 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;
listen-on { 127.0.0.1; 192.168.1.1; };
allow-query { 127.0.0.1; 192.168.1.0/24; };
};
zone "." IN {
type hint;
file "named.named.root";
};
zone "wycdc.com" IN {
type master;
file "data/master-wycdc.com";
allow-update { none; };
};

zone "1.168.192.in-addr.arpa" IN {
type master;
file "data/reverse-192.168.1";
allow-update { none; };
};

---------------------------------------------------------------------------------------------------------------

vi /var/named/chroot/var/named/data/master-wycdc.com -----(no file was there so i made master-wycdc.com)

;
; Zone file for "wycdc.com" - Internal use Only
;
$TTL 1D
@ IN SOA wyc.wycdc.com. (
10 ; Serial
8H ; Refresh
2H ; Retry
4W ; Expire
1D ) ; Minimum
;
IN NS wyc ; Name Server for the domain
;
wycdc.com. IN A 192.168.1.1 ;
wyc IN A 192.168.1.1 ;


--------------------------------------------------------------------------------------------------------------
vi /var/named/chroot/var/named/data/reverse-192.168.1

;
; Reverse File for network "192.168.1.0/24" - Internal ONLY
;
$TTL 1D
@ IN SOA wyc.wycdc.com. (
10 ; Serial
8H ; Refresh
2H ; Retry
4W ; Expire
1D ) ; Minimum
;
IN NS wyc.wycdc.com.
1 IN PTR wyc.wycdc.com

-------------------------------------------------------



when i start service named it give error

Error in named configuration:
dns_rdata_fromtext: data/master-wycdc.com:6: near '8H': not a valid number
zone wycdc.com/IN: loading master file data/master-wycdc.com: not a valid number
_default/wycdc.com/IN: not a valid number
dns_rdata_fromtext: data/reverse-192.168.1:6: near '8H': not a valid number
zone 1.168.192.in-addr.arpa/IN: loading master file data/reverse-192.168.1: not a valid number
_default/1.168.192.in-addr.arpa./IN: not a valid number

please help me out
 
Old 10-29-2010, 07:55 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Hi,

You miss in both the zone files the email address, so bind gets confused. Use something like the following:
Code:
;
; Zone file for "wycdc.com" - Internal use Only
;
$TTL 1D
@ IN SOA wyc.wycdc.com. admin.wycdc.com. (
  10 ; Serial
  8H ; Refresh
  2H ; Retry
  4W ; Expire
  1D ) ; Minimum
;
  IN NS wyc ; Name Server for the domain
;
wycdc.com. IN A 192.168.1.1 ;
wyc IN A 192.168.1.1 ;

Last edited by bathory; 10-29-2010 at 08:08 AM.
 
Old 10-31-2010, 06:11 PM   #3
redh
LQ Newbie
 
Registered: Oct 2010
Posts: 5

Original Poster
Rep: Reputation: 0
thanx i got the DNS and DHCP working. what i mean is both services are up and i am able to ping the server with the server name. but i am not able to ping the client back. what i mean to say is if a client gets a ipaddress from the DHCP pool, how that ipaddress and the system name be written to the dns, i have made it dynammic dns by file the same way as follows:-

Your dhcpd.conf should be as follows
#####################################################################################
ddns-updates on;
ddns-domainname “test.com”;
option ntp-servers 192.168.0.1;
ddns-update-style ad-hoc;
allow unknown-clients;
default-lease-time 86400;
max-lease-time 172800;

option domain-name “test.com”;
option domain-name-servers 192.168.0.1;
option netbios-name-servers 192.168.0.1;
option netbios-dd-server 192.168.0.1;
option netbios-node-type 8;

subnet 192.168.0.1 netmask 255.255.255.0 {
range dynamic-bootp 192.168.0.10 192.168.0.60;
option subnet-mask 255.255.255.0;
option routers 192.168.0.220;
allow unknown-clients;
}

In your named.conf file it should be as follows:

acl lan {
192.168.0.1/24;
127.0.0.1;
};

options {

directory “/var/named”;
listen-on-v6 { any; };
notify no;
forward first;
forwarders {
192.168.0.254;
};
auth-nxdomain yes;
multiple-cnames yes;---- cleared this line as it showerd error
listen-on {
lan;
};
};

zone “test.com” {
type master;
file “/var/named/test.com.zone”;
allow-query {
lan;
};
allow-transfer {
lan;
};
allow-update {
lan;
};
};

zone “0.168.192.in-addr.arpa” {
type master;
file “/var/named/192.168.0.rev.zone”;
allow-query {
lan;
};
allow-transfer {
lan;
};
allow-update {
lan;
};
};

######################################################################

But when i try to ping the client from the server with its ip address it work, but not with its name.
so pls help me to figure out the problem

Last edited by redh; 10-31-2010 at 06:14 PM.
 
Old 11-01-2010, 02:45 PM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Hi,

Change
Quote:
ddns-update-style ad-hoc;
to
Code:
ddns-update-style interim;
because ad-hoc is deprecated.
Also you miss the zone(s) you want your dhcpd server to update and the key that must be exchanged between bind and dhcpd server.
Take a look at this howto to see what you need to do

Regards
 
Old 11-02-2010, 02:41 AM   #5
abhandari
LQ Newbie
 
Registered: Dec 2008
Location: NP
Posts: 28

Rep: Reputation: 1
Thumbs up

Quote:
Originally Posted by redh View Post
Hi everyone..

i am using CentOS 5.5 trying to install DNS

options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/fnamed_stats.txt";
/*
* 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;
listen-on { 127.0.0.1; 192.168.1.1; };
allow-query { 127.0.0.1; 192.168.1.0/24; };
};
zone "." IN {
type hint;
file "named.named.root";
};
zone "wycdc.com" IN {
type master;
file "data/master-wycdc.com";
allow-update { none; };
};

zone "1.168.192.in-addr.arpa" IN {
type master;
file "data/reverse-192.168.1";
allow-update { none; };
};

---------------------------------------------------------------------------------------------------------------

vi /var/named/chroot/var/named/data/master-wycdc.com -----(no file was there so i made master-wycdc.com)

;
; Zone file for "wycdc.com" - Internal use Only
;
$TTL 1D
@ IN SOA wyc.wycdc.com. (
10 ; Serial
8H ; Refresh
2H ; Retry
4W ; Expire
1D ) ; Minimum
;
IN NS wyc ; Name Server for the domain
;
wycdc.com. IN A 192.168.1.1 ;
wyc IN A 192.168.1.1 ;


--------------------------------------------------------------------------------------------------------------
vi /var/named/chroot/var/named/data/reverse-192.168.1

;
; Reverse File for network "192.168.1.0/24" - Internal ONLY
;
$TTL 1D
@ IN SOA wyc.wycdc.com. (
10 ; Serial
8H ; Refresh
2H ; Retry
4W ; Expire
1D ) ; Minimum
;
IN NS wyc.wycdc.com.
1 IN PTR wyc.wycdc.com

-------------------------------------------------------



when i start service named it give error

Error in named configuration:
dns_rdata_fromtext: data/master-wycdc.com:6: near '8H': not a valid number
zone wycdc.com/IN: loading master file data/master-wycdc.com: not a valid number
_default/wycdc.com/IN: not a valid number
dns_rdata_fromtext: data/reverse-192.168.1:6: near '8H': not a valid number
zone 1.168.192.in-addr.arpa/IN: loading master file data/reverse-192.168.1: not a valid number
_default/1.168.192.in-addr.arpa./IN: not a valid number

please help me out
==============
Boss,
Go through this link for your DNS Server Configuration its. It really helps u.
http://www.ispexperts.com.np/?page_id=310
===============
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help needed to setup a DNS server can anyone say how to configure a DNS server subha Linux - Networking 4 04-28-2012 12:50 AM
[SOLVED] How to configure DNS master server on centos shridhar005 Linux - Newbie 3 10-31-2010 09:00 PM
How to configure DNS Server & DNS Client in RHEL4 chanakkya Linux - Networking 1 07-05-2009 02:41 PM
how to configure another dns server to combine use with primary current dns server. hocheetiong Linux - Newbie 1 05-29-2008 07:57 PM
how to configure master dns in windows2003 server and its slave dns in rhel5 suneellinux Linux - Newbie 1 04-11-2008 06:13 PM


All times are GMT -5. The time now is 06:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration