grifon:/etc # cat /etc/named.conf
# Copyright (c) 2001-2004 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Frank Bodammer, Lars Mueller <lmuelle@suse.de>
#
# /etc/named.conf
#
# This is a sample configuration file for the name server BIND 9. It works as
# a caching only name server without modification.
#
# A sample configuration for setting up your own domain can be found in
# /usr/share/doc/packages/bind/sample-config.
#
# A description of all available options can be found in
# /usr/share/doc/packages/bind/misc/options.
options {
# The directory statement defines the name server's working directory
directory "/var/lib/named";
# Write dump and statistics file to the log subdirectory. The
# pathenames are relative to the chroot jail.
dump-file "/var/log/named_dump.db";
statistics-file "/var/log/named.stats";
# The forwarders record contains a list of servers to which queries
# should be forwarded. Enable this line and modify the IP address to
# your provider's name server. Up to three servers may be listed.
#forwarders { 192.0.2.1; 192.0.2.2; };
# Enable the next entry to prefer usage of the name server declared in
# the forwarders section.
#forward first;
# The listen-on record contains a list of local network interfaces to
# listen on. Optionally the port can be specified. Default is to
# listen on all interfaces found on your system. The default port is
# 53.
#listen-on port 53 { 127.0.0.1; };
# The listen-on-v6 record enables or disables listening on IPv6
# interfaces. Allowed values are 'any' and 'none' or a list of
# addresses.
listen-on-v6 { any; };
# The next three statements may be needed if a firewall stands between
# the local server and the internet.
#query-source address * port 53;
#transfer-source * port 53;
#notify-source * port 53;
# The allow-query record contains a list of networks or IP addresses
# to accept and deny queries from. The default is to allow queries
# from all hosts.
#allow-query { 127.0.0.1; };
# If notify is set to yes (default), notify messages are sent to other
# name servers when the the zone data is changed. Instead of setting
# a global 'notify' statement in the 'options' section, a separate
# 'notify' can be added to each zone definition.
notify no;
include "/etc/named.d/forwarders.conf";
};
# To configure named's logging remove the leading '#' characters of the
# following examples.
#logging {
# # Log queries to a file limited to a size of 100 MB.
# channel query_logging {
# file "/var/log/named_querylog"
# versions 3 size 100M;
# print-time yes; // timestamp log entries
# };
# category queries {
# query_logging;
# };
#
# # Or log this kind alternatively to syslog.
# channel syslog_queries {
# syslog user;
# severity info;
# };
# category queries { syslog_queries; };
#
# # Log general name server errors to syslog.
# channel syslog_errors {
# syslog user;
# severity error;
# };
# category default { syslog_errors; };
#
# # Don't log lame server messages.
# category lame-servers { null; };
#};
# The following zone definitions don't need any modification. The first one
# is the definition of the root name servers. The second one defines
# localhost while the third defines the reverse lookup for localhost.
zone "." in {
type hint;
file "root.hint";
};
zone "localhost" in {
type master;
file "localhost.zone";
};
zone "0.0.127.in-addr.arpa" in {
type master;
file "127.0.0.zone";
};
# Include the meta include file generated by createNamedConfInclude. This
# includes all files as configured in NAMED_CONF_INCLUDE_FILES from
# /etc/sysconfig/named
include "/etc/named.conf.include";
logging {
category default { log_syslog; };
channel log_syslog { syslog; };
};
zone "grifon.local" in {
allow-transfer { any; };
file "master/grifon.localXXX";
type master;
};
zone "0.168.192.in-addr.arpa" in {
allow-transfer { any; };
file "master/0.168.192.in-addr.arpaXX";
type master;
};
# You can insert further zone records for your own domains below or create
# single files in /etc/named.d/ and add the file names to
# NAMED_CONF_INCLUDE_FILES.
# See /usr/share/doc/packages/bind/README.SUSE for more details.
$TTL 6h
@ IN SOA ns root.ns (
2008010916; Serial
1h ; Refresh
30m; Retry
7d ; Expire
1h ) ; Minimum
IN NS ns
localhost IN A 127.0.0.1
ns IN A 192.168.0.1
www IN CNAME ns
Кстати. Весьма желательно создать файл /etc/myname с содержимым "ns.grifon.local" и выполнить команду "hostname ns.grifon.local".
после чего соответственно отредактировать /etc/hosts
grifon:/var/lib/named/master # cat /etc/named.conf
# Copyright (c) 2001-2004 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Frank Bodammer, Lars Mueller <lmuelle@suse.de>
#
# /etc/named.conf
#
# This is a sample configuration file for the name server BIND 9. It works as
# a caching only name server without modification.
#
# A sample configuration for setting up your own domain can be found in
# /usr/share/doc/packages/bind/sample-config.
#
# A description of all available options can be found in
# /usr/share/doc/packages/bind/misc/options.
options {
# The directory statement defines the name server's working directory
directory "/var/lib/named";
# Write dump and statistics file to the log subdirectory. The
# pathenames are relative to the chroot jail.
dump-file "/var/log/named_dump.db";
statistics-file "/var/log/named.stats";
# The forwarders record contains a list of servers to which queries
# should be forwarded. Enable this line and modify the IP address to
# your provider's name server. Up to three servers may be listed.
#forwarders { 192.0.2.1; 192.0.2.2; };
# Enable the next entry to prefer usage of the name server declared in
# the forwarders section.
#forward first;
# The listen-on record contains a list of local network interfaces to
# listen on. Optionally the port can be specified. Default is to
# listen on all interfaces found on your system. The default port is
# 53.
#listen-on port 53 { 127.0.0.1; };
# The listen-on-v6 record enables or disables listening on IPv6
# interfaces. Allowed values are 'any' and 'none' or a list of
# addresses.
listen-on-v6 { any; };
# The next three statements may be needed if a firewall stands between
# the local server and the internet.
#query-source address * port 53;
#transfer-source * port 53;
#notify-source * port 53;
# The allow-query record contains a list of networks or IP addresses
# to accept and deny queries from. The default is to allow queries
# from all hosts.
#allow-query { 127.0.0.1; };
# If notify is set to yes (default), notify messages are sent to other
# name servers when the the zone data is changed. Instead of setting
# a global 'notify' statement in the 'options' section, a separate
# 'notify' can be added to each zone definition.
notify no;
include "/etc/named.d/forwarders.conf";
};
# To configure named's logging remove the leading '#' characters of the
# following examples.
#logging {
# # Log queries to a file limited to a size of 100 MB.
# channel query_logging {
# file "/var/log/named_querylog"
# versions 3 size 100M;
# print-time yes; // timestamp log entries
# };
# category queries {
# query_logging;
# };
#
# # Or log this kind alternatively to syslog.
# channel syslog_queries {
# syslog user;
# severity info;
# };
# category queries { syslog_queries; };
#
# # Log general name server errors to syslog.
# channel syslog_errors {
# syslog user;
# severity error;
# };
# category default { syslog_errors; };
#
# # Don't log lame server messages.
# category lame-servers { null; };
#};
# The following zone definitions don't need any modification. The first one
# is the definition of the root name servers. The second one defines
# localhost while the third defines the reverse lookup for localhost.
zone "." in {
type hint;
file "root.hint";
};
zone "localhost" in {
type master;
file "localhost.zone";
};
zone "0.0.127.in-addr.arpa" in {
type master;
file "127.0.0.zone";
};
# Include the meta include file generated by createNamedConfInclude. This
# includes all files as configured in NAMED_CONF_INCLUDE_FILES from
# /etc/sysconfig/named
include "/etc/named.conf.include";
logging {
category default { log_syslog; };
channel log_syslog { syslog; };
};
zone "0.168.192.in-addr.arpa " {
type master;
file "master/0.168.192.in-addr.arpa";
allow-transfer { none; };
allow-update { none; };
};
zone "grifon.local " in {
type master;
file "master/grifon.local";
allow-update { none; };
allow-transfer { none; };
};
Jan 19 13:55:14 grifon named[11157]: shutting down: flushing changes
Jan 19 13:55:14 grifon named[11157]: stopping command channel on 127.0.0.1#953
Jan 19 13:55:14 grifon named[11157]: stopping command channel on ::1#953
Jan 19 13:55:14 grifon named[11157]: no longer listening on 127.0.0.1#53
Jan 19 13:55:14 grifon named[11157]: no longer listening on 192.168.0.1#53
Jan 19 13:55:14 grifon named[11157]: exiting
Jan 19 13:55:14 grifon named[11245]: starting BIND 9.3.2 -t /var/lib/named -u named
Jan 19 13:55:14 grifon named[11245]: found 1 CPU, using 1 worker thread
Jan 19 13:55:14 grifon named[11245]: loading configuration from '/etc/named.conf'
Jan 19 13:55:14 grifon named[11245]: listening on IPv4 interface lo, 127.0.0.1#53
Jan 19 13:55:14 grifon named[11245]: listening on IPv4 interface eth0, 192.168.0.1#53
Jan 19 13:55:14 grifon named[11245]: command channel listening on 127.0.0.1#953
Jan 19 13:55:14 grifon named[11245]: command channel listening on ::1#953
Jan 19 13:55:14 grifon named[11245]: zone 0.0.127.in-addr.arpa/IN: loaded serial 42
Jan 19 13:55:14 grifon named[11245]: zone 0.168.192.in-addr.arpa32/IN: loaded serial 2008010910
Jan 19 13:55:14 grifon named[11245]: dns_rdata_fromtext: master/grifon.local:2: near 'ns': bad name (check-names)
Jan 19 13:55:14 grifon named[11245]: zone grifon.local32/IN: loading master file master/grifon.local: bad name (check-names)
Jan 19 13:55:14 grifon named[11245]: zone localhost/IN: loaded serial 42
Jan 19 13:55:14 grifon named[11245]: running
Jan 19 13:55:19 grifon named[11245]: loading configuration from '/etc/named.conf'
Jan 19 13:55:19 grifon named[11245]: dns_rdata_fromtext: master/grifon.local:2: near 'ns': bad name (check-names)
Jan 19 13:55:19 grifon named[11245]: zone grifon.local32/IN: loading master file master/grifon.local: bad name (check-names)
Jan 19 13:55:29 grifon kernel: martian source 192.168.0.255 from 192.168.0.1, on dev eth1
Jan 19 13:55:29 grifon kernel: ll header: ff:ff:ff:ff:ff:ff:00:e0:4c:dd:1c:c0:08:00
Jan 19 13:55:29 grifon kernel: martian source 192.168.0.255 from 192.168.0.1, on dev eth1
Jan 19 13:55:29 grifon kernel: ll header: ff:ff:ff:ff:ff:ff:00:e0:4c:dd:1c:c0:08:00
Jan 19 13:56:13 grifon kernel: martian source 192.168.1.255 from 192.168.1.99, on dev eth0
Jan 19 13:56:13 grifon kernel: ll header: ff:ff:ff:ff:ff:ff:00:1b:11:14:76:1b:08:00
Jan 19 13:56:30 grifon kernel: martian source 192.168.1.255 from 192.168.1.42, on dev eth0
Jan 19 13:56:30 grifon kernel: ll header: ff:ff:ff:ff:ff:ff:00:e0:4c:ed:36:08:08:00
$TTL 6h
@ IN SOA ns root.ns (
2008011900 ; serial
1h ; refresh
0 ; retry
1w ; expiry
1h ) ; minimum
grifon.local . IN NS ns
localhost IN A 127.0.0.1
ns IN A 192.168.0.1
www IN CNAME ns
В 4 строке сниху у тебя послк grifon.local точка стояла через пробел. Так как У нас уже описана запись SOA выше, нет необходимости писать снова имя узла слева. Хотя вообще это не принципиально. В любом случае, пробел перед точкой нужно убрать =))
Также не забудь изменять всякий раз серийный номер в файле описания зоны если вносишь в нее какие-то изменения.
Jan 19 13:55:19 grifon named[11245]: dns_rdata_fromtext: master/grifon.local:2: near 'ns': bad name (check-names)
Jan 19 13:55:19 grifon named[11245]: zone grifon.local32/IN: loading master file master/grifon.local: bad name (check-names)
Jan 19 14:23:25 grifon su: (to root) Sergey on /dev/pts/1
Jan 19 14:23:46 grifon named[3943]: shutting down: flushing changes
Jan 19 14:23:46 grifon named[3943]: stopping command channel on 127.0.0.1#953
Jan 19 14:23:46 grifon named[3943]: stopping command channel on ::1#953
Jan 19 14:23:46 grifon named[3943]: no longer listening on 127.0.0.1#53
Jan 19 14:23:46 grifon named[3943]: no longer listening on 192.168.0.1#53
Jan 19 14:23:46 grifon named[3943]: exiting
Jan 19 14:23:46 grifon named[4766]: starting BIND 9.3.2 -t /var/lib/named -u named
Jan 19 14:23:46 grifon named[4766]: found 1 CPU, using 1 worker thread
Jan 19 14:23:46 grifon named[4766]: loading configuration from '/etc/named.conf'
Jan 19 14:23:46 grifon named[4766]: listening on IPv4 interface lo, 127.0.0.1#53
Jan 19 14:23:46 grifon named[4766]: listening on IPv4 interface eth0, 192.168.0.1#53
Jan 19 14:23:46 grifon named[4766]: command channel listening on 127.0.0.1#953
Jan 19 14:23:46 grifon named[4766]: command channel listening on ::1#953
Jan 19 14:23:46 grifon named[4766]: zone 0.0.127.in-addr.arpa/IN: loaded serial 42
Jan 19 14:23:47 grifon named[4766]: zone 0.168.192.in-addr.arpa32/IN: loaded serial 2008010910
Jan 19 14:23:47 grifon named[4766]: zone grifon.local/IN: loaded serial 2008011900
Jan 19 14:23:47 grifon named[4766]: zone localhost/IN: loaded serial 42
Jan 19 14:23:47 grifon named[4766]: running
; <<>> DiG 9.3.2 <<>> ns.grifon.local
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45805
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;ns.grifon.local. IN A
;; ANSWER SECTION:
ns.grifon.local. 21600 IN A 192.168.0.1
;; AUTHORITY SECTION:
grifon.local. 21600 IN NS ns.grifon.local.
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Jan 19 14:57:34 2008
;; MSG SIZE rcvd: 63
Офигеть вообще, и виндовые машины начали его пинговать!
Всё теперь запишу конфиги на диск и буду ложить под подушку перед сном! :-D
Забыл сказать Огромное спасибо headcrab за помощь в настроке.
если не пингуется grifon.local -- то это понятное дело, так как в зоне нет A записи для этого ресурса. Если необходимо всего-то добавить одну строчку в конф зоны -- grifon.local. IN A 192.168.0.1 и все будет в порядке.
Кстати говоря, в твоем предыдущем сообщении вывод команды dig говорит о нормальной работе dns сервера:
Он как раз таки и вернул тебе все, что необходимо знать о запрашиваемом домене grifon.local -- имя NS сервера, ответственного за зону, мыло админа и остальные служебные данные.