I'm struggling for a last couple of days to make my bind
work. I believe, it have a very generic config, but somehow it won't serve a proper IP of my server to local clients, when the domain name is used (myho.st
). System is Debian Wheezy. named-checkconf
does not report any errors.
Configs are as follows:
/etc/bind/named.conf:
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.log";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
acl localhost_acl {
127.0.0.1;
};
acl internal_10_acl {
192.168.10.0/24;
};
/etc/bind/named.conf.local:
include "/etc/bind/zones.rfc1918";
view "local_view" {
match-clients { localhost_acl; internal_10_acl; };
zone "myho.st" {
type master;
file "/etc/bind/db.myho.st";
};
};
/etc/bind/zones.rfc1918:
view "global_view" {
zone "10.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "16.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "17.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "18.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "19.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "20.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "21.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "22.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "23.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "24.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "25.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "26.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "27.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "28.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "29.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "30.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
zone "31.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
};
/etc/bind/named.conf.default-zones:
view "default_view" {
// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};
// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
};
/etc/bind/named.conf.log:
logging {
channel update_debug {
file "/var/log/bind/update_debug.log" versions 3 size 100k;
severity debug;
print-severity yes;
print-time yes;
};
channel security_info {
file "/var/log/bind/security_info.log" versions 1 size 100k;
severity info;
print-severity yes;
print-time yes;
};
channel bind_log {
file "/var/log/bind/bind.log" versions 3 size 1m;
severity info;
print-category yes;
print-severity yes;
print-time yes;
};
category default { bind_log; };
category lame-servers { null; };
category update { update_debug; };
category update-security { update_debug; };
category security { security_info; };
};
/etc/bind/named.conf.options:
options {
directory "/var/cache/bind";
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { none; };
listen-on {
127.0.0.1;
192.168.10.1;
};
allow-transfer { none; };
allow-query { localhost_acl; internal_10_acl; };
};
and finally /etc/bind/db.myho.st:
$TTL 3h
@ IN SOA ns.myho.st. hostmaster.myho.st. (
4 ; Serial
3h ; Refresh after 3 hours
1h ; Retry after 1 hour
1w ; Expire after 1 week
1h ) ; Negative caching TTL of 1 day
;
@ IN NS ns.myho.st.
@ IN A 192.168.10.1
ns IN A 192.168.10.1
named-checkzone myho.st /etc/bind/db.myho.st
doesn't report any errors.
My clients are in 192.168.10.0/24
subnet and all of them can ping 192.168.10.1
, which is server's IP. But the myho.st
domain name is getting resolved through the ISP's DNS to the global IP, however seems like served by my server:
user@client:~$ nslookup myho.st
Server: 192.168.10.1
Address: 192.168.10.1#53
Non-authoritative answer:
Name: myho.st
Address: *some global IP*
Obviously I missed some essential setting in named.conf*
, but I fail to see which exactly. Probably the views
aren't configured properly. Please advise.