Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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
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.
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]#
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 -
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";
};
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.