Dns For those who need to do the whole internal vs external IP resolution (ie you have to NAT because you're behind a firewall) and would like an idea of what the bind settings should look like, I've included mine below:
main.cf
include "/etc/bind/named.conf.options";
// Views
view "int" {
match-clients { localhost; };
recursion yes;
zone "mydomain1.com" {
type master;
file "db.mydomain1.com.int";
allow-transfer { any; };
};
zone "mydomain2.com.au" {
type master;
file "db.mydomain2.com.au.int";
allow-transfer { none; };
};
zone "." {
type hint;
file "/etc/bind/db.root";
};
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";
};
};
view "externalnet" {
match-clients { any; };
recursion no;
zone "mydomain1.com" {
type master;
file "db.mydomain1.com.ext";
allow-transfer { none; };
};
zone "mydomain2.com.au" {
type master;
file "db.mydomain2.com.au.ext";
allow-transfer { any; };
};
};
include "/etc/bind/named.conf.local";
--------------------
Note the actual db files are exactly the same as the normal with int files show the private ips and the external showing the live ips.
Also important to put a forwarder in .named.conf.options so the mail server will be able to resolve external addresses. And to list the server in resolv.conf
Also need to secure bind if its going to respond to external requests. |