Всем доброго времени суток! Была поставлена задача: поднять DNS сервер для обслуживания небольшой сети без выхода в интернет.
Файл конфигурации named.conf:
======================================================================================================
// $FreeBSD: src/etc/namedb/named.conf,v 1.29.2.3.2.1 2010/06/14 02:09:06 kensmith Exp $
// This networks can ask our dns.
acl "corpnets" {192.168.1.0/24; 127.0.0.1; };options {
// All file and path names are relative to the chroot directory,
// if any, and should be fully qualified.
directory "/etc/namedb";
pid-file "/var/run/named/pid";
dump-file "/var/dump/named_dump.db";
statistics-file "/var/stats/named.stats";
// BEGIN OPTIONS.
allow-query { "corpnets"; };
listen-on { 127.0.0.1; 192.168.1.1; };
recursion yes;
zone "." { type hint; file "/etc/namedb/named.root"; };
// RFC 1912 (and BCP 32 for localhost)
zone "localhost" { type master; file "master/localhostf.db"; };
zone "0.0.127.in-addr.arpa" { type master; file "master/localhostr.db"; };
zone "xonix.lan" {
type master;
file "master/xonix.fwd.db";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "master/xonix.rev.db";
};
================================================================================================
Файл зоны прямого запроса для домена xonix.lan xonix.fwd.db:
================================================================================================
; $FreeBSD: src/etc/namedb/master/empty.db,v 1.1.12.1.4.1 2010/06/14 02:09:06 kensmith Exp $
$TTL 3h
xonix.lan. IN SOA testdns.xonix.lan. nobody.xonix.lan. (
42 1d 12h 1w 3h )
; Serial, Refresh, Retry, Expire, Neg. cache TTL
; DNS servers
IN NS testdns.xonix.lan.
; Machine Names
localhost IN A 127.0.0.1
testdns IN A 192.168.1.1
yaroha IN A 192.168.1.2
yaroha2 IN A 192.168.1.3
=================================================================================================
Файл зоны обратного запроса для домена xonix.lan xonix.rev.db:
===============================================================================================
; $FreeBSD: src/etc/namedb/master/empty.db,v 1.1.12.1.4.1 2010/06/14 02:09:06 kensmith Exp $
$TTL 3h
1.168.192.in-addr.arpa. IN SOA testdns.xonix.lan. nobody.xonix.lan. (
42 1d 12h 1w 3h )
; Serial, Refresh, Retry, Expire, Neg. cache TTL
IN NS testdns.xonix.lan.
1 IN PTR testdns.xonix.lan.
2 IN PTR yaroha.xonix.lan.
3 IN PTR yaroha2.xonix.lan.
===============================================================================================
Файл зоны для localhost localhostf.db:
===============================================================================================
; $FreeBSD: src/etc/namedb/master/localhost-forward.db,v 1.1.12.1.4.1 2010/06/14 02:09:06 kensmith Exp $
$TTL 3h
localhost. SOA localhost. nobody.localhost. 42 1d 12h 1w 3h
; Serial, Refresh, Retry, Expire, Neg. cache TTL
NS localhost.
A 127.0.0.1
AAAA ::1
===============================================================================================
Файл обратной зоны для localhsot localhostr.db:
===============================================================================================
; $FreeBSD: src/etc/namedb/master/localhost-reverse.db,v 1.1.12.1.4.1 2010/06/14 02:09:06 kensmith Exp $
$TTL 3h
@ SOA localhost. nobody.localhost. 42 1d 12h 1w 3h
; Serial, Refresh, Retry, Expire, Neg. cache TTL
NS localhost.
1.0.0 PTR localhost.
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 PTR localhost.
=================================================================================================
Проблема №1:
В /var/log/messages при старте системы пишется:
Feb 5 03:33:14 testdns named[730]: starting BIND 9.6.2-P2 -t /var/named -u bind
Feb 5 03:33:14 testdns named[730]: built with '--prefix=/usr' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-threads' '--disable-ipv6' '--enable-getifaddrs' '--disable-linux-caps' '--with-openssl=/usr' '--with-randomdev=/dev/random' '--without-idn' '--without-libxml2'
Feb 5 03:33:14 testdns named[730]: command channel listening on 127.0.0.1#953
Feb 5 03:33:14 testdns named[730]: command channel listening on ::1#953
Feb 5 03:33:14 testdns named[730]: the working directory is not writable - ПРОБЛЕМА!!!!!!!!!
Feb 5 03:33:14 testdns named[730]: running
Как это исправить?
Проблема №2:
Хоть в сети пропинговка хостов по именам и по IP работает нормально, мне не нравиться ответ на команду dig:
; <<>> DiG 9.6.1-P3 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 16547
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;. IN NS
;; Query time: 8 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sat Feb 5 01:42:23 2011
;; MSG SIZE rcvd: 17
Почему на любой мой запрос dig выдает SERVFAIL?
Пожалуйста, обьясните эти две проблемы как можно точнее и основательней, так как я новенький в администрировании DNS сервера.
Заранее благодарен всем за помощь!