<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'> <div class="gmail_quote"><div dir="ltr"><div>
Hello,<BR>I've got a raspberry pi with 5 network interfaces (3 WLAN and
two wired LAN).
Also, I have set up a BIND 9 server. Now I want to give the PI (the
hostname is "DEV") a different IP address for every single interface.<BR>
For example: when a client from the network <a href="http://192.168.2.0/24" target="_blank">192.168.2.0/24</a> looks up
the hostname "DEV.home.lan", he should get the response that
"DEV.home.lan" has the IP 192.168.2.100.
When a client of the <a href="http://192.168.10.0/24" target="_blank">192.168.10.0/24</a> network looks up that hostname, the
IP should be 192.168.10.1.<BR>
As far as I know, this can be done using views. I could'nt get it working so I have some questions.
Q1: Why do I get the IP address "192.168.2.100" for "DEV.home.lan" from both the <a href="http://192.168.2.0/24" target="_blank">192.168.2.0/24</a> and the <a href="http://192.168.10.0/24" target="_blank">192.168.10.0/24</a> network?<BR>
The configuration files are set up as follows:
1.<BR>
<code>/etc/bin/named.conf</code> <BR>
<pre><code>include "/etc/bind/named.conf.options"<wbr>;
include "/etc/bind/named.conf.local";
#include "/etc/bind/named.conf.default-<wbr>zones";
</code></pre>
I had to comment out the last line with the default-zones file because otherwise I get the error <code>/etc/bind/named.conf.default-<wbr>zones:2: when using 'view' statements, all zones must be in views</code> (I think it's a default config file, but I can provide it when necessary). <BR>
Q2: What exactly are these zones in the file for? Do I need them?<BR>
2.<BR>
<code>/etc/bind/named.conf.options</code><BR>
<pre><code>options {
directory "/var/cache/bind";
forwarders {
8.8.8.8;
8.8.4.4;
};
dnssec-validation no;
empty-zones-enable yes;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
</code></pre>
I don't think the error is in that file.<BR>
3.
<code>/etc/bind/named.conf.local</code><BR>
<pre><code>view "local" {
match-clients { any; };
zone "home.lan" IN {
type master;
file "/etc/bind/db.home.lan";
};
};
view "ext" {
match-clients { <a href="http://192.168.2.0/24;" target="_blank">192.168.2.0/24;</a>};
zone "2.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.rev.2.168.192.<wbr>in-addr.arpa";
};
};
view "wlan0" {
match-clients { <a href="http://192.168.3.0/24;" target="_blank">192.168.3.0/24;</a>};
zone "3.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.rev.3.168.192.<wbr>in-addr.arpa";
};
};
view "wlan00" {
match-clients {<a href="http://192.168.4.0/24;" target="_blank">192.168.4.0/24;</a>};
zone "4.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.rev.4.168.192.<wbr>in-addr.arpa";
};
};
view "wlan01" {
match-clients {<a href="http://192.168.5.0/24;" target="_blank">192.168.5.0/24;</a>};
zone "5.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.rev.5.168.192.<wbr>in-addr.arpa";
};
};
view "int" {
match-clients {<a href="http://192.168.10.0/24;" target="_blank">192.168.10.0/24;</a>};
zone "10.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.rev.10.168.192.<wbr>in-addr.arpa";
};
};
</code></pre>
4.
<code>/etc/bind/db.home.lan</code><BR>
<pre><code>home.lan. IN SOA DEV.home.lan. hostmaster.home.lan. (
<a href="tel:2013120101" target="_blank" value="+12013120101">2013120101</a> ; serial
8H ; refresh
4H ; retry
4W ; expire
1D ; minimum
)
home.lan. IN NS DEV.home.lan.
home.lan. IN MX 10 DEV.home.lan.
; Set the address for localhost.home.lan
localhost IN A 127.0.0.1
; Set the hostnames in alphabetical order
DEV IN A 192.168.2.100
router IN A 192.168.2.1
proxy IN CNAME DEV.home.lan.
wpad IN CNAME DEV.home.lan.
</code></pre>
And finally, <code>/etc/bind/db.rev.10.168.192.<wbr>in-addr.arpa</code><BR>
<pre><code>; IP Address-to-Host DNS Pointers for the 192.168.10 subnet
@ IN SOA DEV.home.lan. hostmaster.home.lan. (
<a href="tel:2013120101" target="_blank" value="+12013120101">2013120101</a> ; serial
8H ; refresh
4H ; retry
4W ; expire
1D ; minimum
)
; define the authoritative name server
IN NS DEV.home.lan.
; our hosts, in numeric order
1 IN PTR router.home.lan.
1 IN PTR DEV.home.lan.
</code></pre>
Thank you!<BR>
</div></div>
</div> </div></body>
</html>