LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 11-09-2007, 04:30 PM   #1
nogden
LQ Newbie
 
Registered: Nov 2007
Distribution: RHEL4, RH9
Posts: 6

Rep: Reputation: 0
Need help with BIND config on RHEL4


I am setting up a DNS server and need some assistance. I am new to the forum but have some RedHat experience. My goal is to be able to use DNS to set up a few hostname to IP address mappings, nothing too complicated, but I have never set up a DNS server before. I have registered my domain, ocsnetwork.net, and for example, want to route photo.ocsnetwork.net to 68.254.124.214. I was going to use my registrar's DNS hosts wizard to do this but that hasn't worked and I've been waiting 8 days for a response to my support ticket, so I thought maybe I'd try to set up my own DNS server. I have configured my DNS server as best as I could but when I attempt to start named, I get "named failed. The error was: ". My config files are posted below, They are the default config's, just with the addition of my domain: Thanks for your assistance!

My named.conf:
Code:
options {
	directory "/var/named";
	dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
	query-source address * port 53;
};
 
controls {
	inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

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

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 "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
        type master;
	file "named.ip6.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; };
};

zone "ocsnetwork.net" in {
	type master;
	file "ocsnetwork.net";
};

include "/etc/rndc.key";
My ocsnetwork.net, as defined in named.conf:
Code:
$TTL	86400
@		IN SOA	server.ocsnetwork.net. hostmaster.ocsnetwork.net. (
					00000001	; serial (d. adams)
					3H		; refresh
					15M		; retry
					1W		; expiry
					1D )		; minimum
	        IN NS		server.ocsnetwork.net
www		IN A		68.254.124.211
photo		IN A		68.254.124.214
 
Old 11-09-2007, 06:38 PM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
There are a couple of possibilities. The ocsnetwork.net file should be in /var/named according to your named.conf. Is it there, or is it in /etc/bind with the config files? The zone file itself doesn't look very good, it has major problems as is. The serial number has to change though. The format for serial number is the date, year month day, than an additional 2 digits for revisions during the day. For example, one done today would be 2007110900. The next change would become 2007110901, then the first tomorrow would be 2007111000.

I would set the zone file up like this:

Code:
$ORIGIN .
$TTL 3600       ; 1 hour
ocsnetwork.net   IN SOA  server.ocsnetwork.net. hostmaster.ocsnetwork.net. (
                                2007110900 ; serial
                                3600       ; refresh (1 hour)
                                500        ; retry (8 minutes 20 seconds)
                                1209600    ; expire (2 weeks)
                                3600       ; minimum (1 hour)
                                )
$TTL 86400      ; 1 day
                        NS      server.ocsnetwork.net.

$TTL 3600       ; 1 hour
                     IN A       68.254.124.211
                        MX      10 mail.ocsnetwork.net.
$ORIGIN ocsnetwork.net.
server               IN A       68.254.124.211
www                  IN A       68.254.124.211
photo                IN A       68.254.124.214
mail                 IN A       68.254.124.211
Obviously I guessed on some IPs and such, but you can get much more accomplished with my file. You can't have any name in the file that isn't defined, like you have server.ocsnetwork.net listed, then you never define an address for that. That cannot work. You must spell out addresses for everything.

Change the zone, make sure it is in the right place, and then try the tools named-checkconf and named-checkzone , make sure everything is cool. Also, if you want to log things to find problems easier, you can set up logging in the named.conf file. If you want that, write back, or check other posts by me about BIND, I've posted logging directives in the past.

Peace,
JimBass
 
Old 11-09-2007, 08:12 PM   #3
nogden
LQ Newbie
 
Registered: Nov 2007
Distribution: RHEL4, RH9
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for your assistance, I feel better about the configuration, but named still won't start. When I attempt to start named from command line, I don't get any error messages (see below), but the server still doesn't start. I only get an error message if I attempt to start the service from system-config-services. I also can't get any feedback with named-checkconf. My zone files are in /var/named.

This is what is happening with named (I'm in /var/named right now):

[root@server named]# /usr/sbin/named
[root@server named]# /usr/sbin/named-checkconf
[root@server named]# /usr/sbin/named-checkzone ocsnetwork.net ocsnetwork.net
zone ocsnetwork.net/IN: loaded serial 2007110900
OK
[root@server named]#

Hope this gives you more info. on my problem!
 
Old 11-10-2007, 10:20 AM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
Try doing some logging and see what is happening. Add this to your named.conf, and create the directory /var/log/named, and make whatever user BIND runs as (usually bind:bind or named:named) the owner of the directory -

Code:
mkdir /var/log/named
touch /var/log/named/bind.log
chown -R bind:bind /var/log/named
And add this into your named.conf to do some logging -

Code:
logging{
  channel simple_log {
  file "/var/log/named/bind.log" versions 3 size 5m;
  severity info;
  print-time yes;
  print-severity yes;
  print-category yes;
};
Restart named, and you should have some logs appearing.

You version of BIND might already be logging somewhere. I you can find it, you should get the error from that as well.

Peace,
JimBass
 
Old 11-14-2007, 03:54 PM   #5
nogden
LQ Newbie
 
Registered: Nov 2007
Distribution: RHEL4, RH9
Posts: 6

Original Poster
Rep: Reputation: 0
Okay, bind still won't start. I was able to get this output from the named-checkzone command:
Code:
dns_master_load: ocsnetwork.net:3: ignoring out-of-zone data (ocsnetwork.net)
dns_master_load: ocsnetwork.net:17: ignoring out-of-zone data (server.ocsnetwork.net)
dns_master_load: ocsnetwork.net:18: ignoring out-of-zone data (www.ocsnetwork.net)
dns_master_load: ocsnetwork.net:19: ignoring out-of-zone data (photo.ocsnetwork.net)
dns_master_load: ocsnetwork.net:20: ignoring out-of-zone data (mail.ocsnetwork.net)
zone /var/named/ocsnetwork.net/IN: could not find NS and/or SOA records
zone /var/named/ocsnetwork.net/IN: has 0 SOA records
zone /var/named/ocsnetwork.net/IN: has no NS records
I only got that after updating to bind 9.3.4-7. I also simplified named.conf (see below). That config file I found at another site and I thought I'd give it a try. When I ran named-checkconfig, it suggested adding a }; after the last line in logging. I did so but named still won't run. I posted the output from named-checkzone because I was not sure how to address those problems. I also confirmed that the zone files mentioned in the config file exist and are in the right place, they are. Also, do i need trailing dots after the host records in the zone file? ex: server.ocsnetwork.net.

My named.conf:
Code:
options {
	directory "/var/named";
};

logging {
	channel simple_log {
	file "/var/log/named/bind.log" versions 3 size 5m;
	severity info;
	print-time yes;
	print-severity yes;
	print-category yes;
	};
};

zone "." {
	type hint;
	file "named.ca";
};

zone "0.0.127.in-addr.arpa" {
	type master;
	file "named.local";
};

zone "ocsnetwork.net" {
	type master;
	file "ocsnetwork.net";
};
 
Old 11-14-2007, 06:14 PM   #6
nogden
LQ Newbie
 
Registered: Nov 2007
Distribution: RHEL4, RH9
Posts: 6

Original Poster
Rep: Reputation: 0
I also forgot to mention that nothing ever appeared in the log that you gave me the code for.
 
Old 11-15-2007, 01:55 PM   #7
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
Post your full named.conf and zone file. I'm gald to help, but need the full data to work with.

Peace,
JimBass
 
Old 11-15-2007, 03:29 PM   #8
nogden
LQ Newbie
 
Registered: Nov 2007
Distribution: RHEL4, RH9
Posts: 6

Original Poster
Rep: Reputation: 0
My full named.conf is in my last post and for now, the zone file is exactly as you gave it to me. The names you made up are exactly what I need for now, so I haven't modified it. Also, there is no controls statement in the named.conf file because for some reason, named-checkconf would not recognize the controls statement.

Last edited by nogden; 11-15-2007 at 03:30 PM.
 
  


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
system-config-bind ziz300 Linux - Networking 1 05-26-2006 05:48 AM
Bind config tool serverjunkie Linux - Software 0 01-18-2006 04:47 AM
Working Bind config Files jagster Linux - Networking 1 09-13-2005 10:48 AM
Help with DIND and redhat-config-bind pembo13 Linux - Newbie 2 09-24-2003 05:52 PM
bind config (DNS) viniosity Linux - Software 3 06-30-2003 11:24 AM


All times are GMT -5. The time now is 08:52 AM.

Main Menu
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