LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 06-21-2012, 04:27 PM   #1
Murphyslaw4267
LQ Newbie
 
Registered: Jun 2012
Posts: 3

Rep: Reputation: Disabled
BIND Nameserver Setup


Hi there,
I'm trying to set up my server running CentOS 6.2 to be able to host domains. I have registered a domain with godaddy and registered the hosts for ns1.serverhobbyistdedicated.com and ns2.serverhobbyistdedicated.com
I have tried to set up BIND using webmin but I couldn't get it to work. I am asking for help on how to set up these name servers I registered on my server. I have become quite frustrated I've googled around and haven't had much luck. I would really, really appreciated any help that anyone can provide. Here are my files that I believe are relevant to this sort of thing, bear with me as I am a linux novice (I'm learning though).

resolv.conf
# Generated by NetworkManager
search google.com
nameserver 4.2.2.1
nameserver 8.8.8.8

named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named( DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//


options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; };
recursion yes;

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
};


zone "serverhobbyistdedicated.com" in {
type master;
file "serverhobbyistdedicated.com";
};

logging {channel default_debug {
file "data/named.run";
severity dynamic;
};
};

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

include "/etc/named.rfc1912.zones";

This is a file a tutorial I found told me to create. It's in /var/named

$TTL 14400
@ 86400 IN SOA ns1.serverhobbyistdedicated.com. admin@serverho$
2008021501 ; serial, todays date+todays
86400 ; refresh, seconds
7200 ; retry, seconds
3600000 ; expire, seconds
86400 ) ; minimum, seconds
serverhobbyistdedicated.com 86400 IN NS ns1.serverhobbyistdedicated.com.
serverhobbyistdedicated.com.com. 86400 IN NS ns2.serverhobbyistdedicated.com.
ns1.serverhobbyistdedicated.com. IN A 108.61.17.178
ns2.serverhobbyistdedicated.com. IN A 108.61.17.179
website.com. IN A 108.61.17.179
localhost.website.com. IN A 127.0.0.1
website.com. IN MX 0 website.com.
mail IN CNAME serverhobbyistdedicated.com.
www IN CNAME serverhobbyistdedicated.com.
ftp IN A 108.61.17.179

When I try to restart BIND I get this error.

Quote:

Stopping named: [ OK ]
Starting named:
Error in named configuration:
serverhobbyistdedicated.com:10: ignoring out-of-zone data (serverhobbyistdedicated.com.com)
serverhobbyistdedicated.com:13: ignoring out-of-zone data (website.com)
serverhobbyistdedicated.com:14: ignoring out-of-zone data (localhost.website.com)
serverhobbyistdedicated.com:15: ignoring out-of-zone data (website.com)
zone serverhobbyistdedicated.com/IN: has no NS records
zone serverhobbyistdedicated.com/IN: not loaded due to errors.
_default/serverhobbyistdedicated.com/in: bad zone
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
zone 1.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: loaded serial 0
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0
[FAILED]

Thank you!
 
Old 06-22-2012, 09:35 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You didn't provide your actual zone file.

named.conf specifies zones and the zone files used for same but you have to create the zone file it points to.
I suspect you have a zone file based on messages like:
serverhobbyistdedicated.com:10: ignoring out-of-zone data (serverhobbyistdedicated.com.com)

The .com.com in above line is telling as it suggests you didn't properly define your zone file. The SOA record at the top of it needs to specify the zone (e.g. serverhobbyistdedicated.com) then the A records and others are assumed to be for that. Any record you create in the zone file that literally has "serverhobbyistdedicate.com" in it after the SOA should be terminated with a dot for example:
billybob.serverhobbyistdedicated.com. A 192.168.1.1
alternatively you could enter the record in the zone file as simply:
billybob A 192.168.1.1
If your SOA record at top of zone specifically shows it is for serverhobbyistdedicated.com it will append that to billybob in the latter record because billybob does NOT have the dot terminating it as the prior example did.

The fact that it is appending .com makes it sound like you tried to create a zone with SOA for .com rather than for serverhobbyistdedicated.com which is not allowed.

The out of zone information means you are trying to define records that are NOT part of the zone you defined in the SOA.

Also named.conf appears to only be listening on localhost (127.0.0.1). If you intend to have other servers access it you need to have it listen on the IP of the server.

You might want to have a look at the ISC documentation for your BIND version. (ISC is the author of BIND.)
http://www.isc.org/software/bind/documentation
 
Old 06-22-2012, 06:03 PM   #3
Murphyslaw4267
LQ Newbie
 
Registered: Jun 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
I really appreciate you taking the time to help me out. I have followed your instructions and am no longer getting any errors when I restart BIND, but I do get an odd period that shows up during the restart if that means anything.

Stopping named: . [ OK ]
Starting named: [ OK ]

However I am still unable to resolve my domain name. Here is my corrected named.conf and zone file.

$TTL 14400
@ 86400 IN SOA ns1.serverhobbyistdedicated.com. admin@serverhobbyistdedicated.com. (
2008021501 ; serial, todays date+todays
86400 ; refresh, seconds
7200 ; retry, seconds
3600000 ; expire, seconds
86400 ; minimum, seconds
)
serverhobbyistdedicated.com. 86400 IN NS ns1.serverhobbyistdedicated.com.
serverhobbyistdedicated.com. 86400 IN NS ns2.serverhobbyistdedicated.com.
ns1 IN A 108.61.17.178
ns2 IN A 108.61.17.179
serverhobbyistdedicated.com. IN A 108.61.17.179
localhost.serverhobbyistdedicated.com. IN A 127.0.0.1
serverhobbyistdedicated.com. IN MX 0 serverhobbyistdedicated.com.
mail IN CNAME serverhobbyistdedicated.com.
www IN CNAME serverhobbyistdedicated.com.
ftp IN A 108.61.17.181
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
listen-on port 53 { 108.61.17.179; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; };
recursion yes;

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
};


zone "serverhobbyistdedicated.com" in {
type master;
file "serverhobbyistdedicated.com";
};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

zone "." IN {
type hint;

dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
};


zone "serverhobbyistdedicated.com" in {
type master;
file "serverhobbyistdedicated.com";
};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

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

include "/etc/named.rfc1912.zones";




Also, can my resolv.conf be any name server (currently I'm using google's as my primary) or do I have to set it as the name servers I'm trying to set up with BIND?


Thank you so much!
 
Old 06-22-2012, 07:43 PM   #4
Murphyslaw4267
LQ Newbie
 
Registered: Jun 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
I figured out what the issue was and corrected it. Thank you!
 
Old 06-25-2012, 10:20 AM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by Murphyslaw4267 View Post
I figured out what the issue was and corrected it. Thank you!
Glad I could help.

Could you add what your did to fix this then mark the thread as resolved in thread tools? It helps others with similar problems in future more quickly find solutions in web searches.
 
  


Reply



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
[SOLVED] SOA for nameserver can't be retrieved, possible port or BIND misconfiguration craseal Linux - Server 2 08-24-2010 07:08 PM
[SOLVED] bind caching nameserver: views/firewalling (RHEL5/CentOS5) deadeyes Linux - Server 4 10-15-2009 09:52 AM
dig will not work external to the bind nameserver stevemarci Linux - Newbie 4 06-12-2006 02:31 PM
BIND: wildcard DNS and nameserver noisybastard Linux - Networking 0 10-05-2003 04:13 PM
How to Setup a Nameserver dcdjservices Linux - Networking 1 08-01-2003 04:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:15 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
Open Source Consulting | Domain Registration