Bind - HOWTO

Hier ein kleines HOWTO, wie man den Bind Deamon konfiguriert. Bind (Berkley Internet Name Domain) ist eine häfig eingesetzte Implemenation des DNS protocols und wird vom ISC (Internet System Consortium) entwickelt.

Als erstes sollte schon ein Betriebssystem eingerichet sein. Weiter muss Bind installiert werden, vozugsweise über das Package Management System (bei Debian z.B. apt-get install bind9) oder einfach kompilieren.

named.conf - Zentrales Konfigurationsfile für Bind

--- named.conf ---

options {
	directory "/var/named";
	# the default is to fail, if the master file is not correct
	check-names master warn;

	pid-file "/var/run/named.pid";
	#statistics-interval 720;
	#cleaning-interval 720;

	datasize default;
	stacksize default;
	coresize default;
	files unlimited;
	recursion yes;

	multiple-cnames no;		// if yes, then a name my have more
					// than one CNAME RR.  This use
					// is non-standard and is not
					// recommended, but it is available
					// because previous releases supported
					// it and it was used by large sites
					// for load balancing.

	# the default is to listen on port 53 on all available interfaces
	# you can also give a detailed list:

        forward first;
	
	# +++ DNS forwarders +++
	forwarders {
                193.231.13.232;
                193.231.12.168;
        };

	# +++ Netzwerk anfragen beantworten +++	
	listen-on { 127.0.0.1/32; 192.168.1.0/24; };

	# +++ keine unnoetigen pakete! +++
        notify no;

	# +++ clean up only every 12 hours +++
	cleaning-interval 720;
	statistics-interval 720;

};

zone "." IN {
        type hint;
        file "root.hint";
};

zone "localhost" IN {			# +++ localhost +++
	type master;
	file "localhost.zone";
	check-names fail;
	allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
	type master;
	file "127.0.0.zone";
	check-names fail;
	allow-update { none; };
};

zone "mynet.local" IN { 		# +++ mynet.local +++
        notify no; 
        type master; 
        file "mynet.local.zone"; 
}; 

zone "1.168.192.in-addr.arpa" IN { 
        notify no; 
        type master; 
        file "192.168.1.zone"; 
};

--- eof ---

192.168.1.zone - Zone File 1

--- 192.168.1.zone ---

$ORIGIN 1.168.192.in-addr.arpa.

@			1D IN SOA	server.mynet.local. emailadresse.server.mynet.local. (
					42		; serial (d. adams)
					3H		; refresh
					15M		; retry
					1W		; expiry
					1D )		; minimum

			1D IN NS	server.mynet.local.

1			1D IN PTR	server.mynet.local.
1			1D IN PTR	www.mynet.local.
2			1D IN PTR	host1.mynet.local.

--- eof ---

mynet.local.zone - Zone File 2

--- mynet.local.zone ---

$ORIGIN mynet.local.

@                       1D IN SOA       server.mynet.local emailadresse.server.mynet.local ( 
                                        42              ; serial (d. adams) 
                                        3H              ; refresh 
                                        15M             ; retry 
                                        1W              ; expiry 
                                        1D )            ; minimum 

                        1D IN TXT       "Mein guter Server!" 
                        1D IN NS        server
                        1D IN MX        10 mailserver 

server                  1D IN A         192.168.1.1
			1D IN TXT	"Server"

www                	1D IN A         192.168.1.1
			1D IN TXT	"WebServer"

host1                   1D IN A         192.168.1.2
			1D IN TXT	"Wokstation 1"
			
--- eof ---

So, und wenn man die Dateien angepasst hat und den Deamon gestartet hat, sollte man nun DNS abfragen an den Server schicken können.