Difference between revisions of "DNS Server linux, bind"

From Ilianko
Line 4: Line 4:
 
####
 
####
 
<code><pre>
 
<code><pre>
zone "tugab.bg"
+
zone "tugab.bg"
{
+
{
  type master;
+
type master;
  file "/etc/bind/zones/tugab.bg.db";
+
file "/etc/bind/zones/tugab.bg.db";
};
+
};
zone "4.16.172.in-addr.arpa"
+
zone "4.16.172.in-addr.arpa"
{
+
{
  type master;
+
type master;
  file "/etc/bind/zones/rev.4.16.172.in-addr.arpa";  
+
file "/etc/bind/zones/rev.4.16.172.in-addr.arpa";  
};
+
};
 
</pre></code>
 
</pre></code>
 
####
 
####
Line 21: Line 21:
  
 
<code><pre>
 
<code><pre>
forwarders {
+
forwarders {
 
  194.141.15.1;
 
  194.141.15.1;
};
+
};
 
</pre></code>
 
</pre></code>
  
 
*sudo mkdir /etc/bind/zones
 
*sudo mkdir /etc/bind/zones
 
*sudo gedit  /etc/bind/zones/tugab.bg.db
 
*sudo gedit  /etc/bind/zones/tugab.bg.db
###
+
 
 
<code><pre>
 
<code><pre>
 
$TTL 60
 
$TTL 60
Line 43: Line 43:
 
www2   IN A 172.16.4.2
 
www2   IN A 172.16.4.2
 
</pre></code>
 
</pre></code>
 +
 
###
 
###
 
sudo gedit rev.4.16.172.in-addr.arpa
 
sudo gedit rev.4.16.172.in-addr.arpa

Revision as of 16:59, 13 August 2011

  • sudo apt-get install bind9
  • sudo gedit /etc/bind/named.conf.local
zone "tugab.bg"
{
 type master;
 file "/etc/bind/zones/tugab.bg.db";
};
zone "4.16.172.in-addr.arpa"
{
 type master;
 file "/etc/bind/zones/rev.4.16.172.in-addr.arpa"; 
};
  • sudo gedit /etc/bind/named.conf.options


forwarders {
 194.141.15.1;
};
  • sudo mkdir /etc/bind/zones
  • sudo gedit /etc/bind/zones/tugab.bg.db
$TTL	60
tugab.bg.	IN	SOA	n1.tugab.bg. admin.tugab.bg. (
			      1		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
tugab.bg. IN 	NS 	n1.tugab.bg.
@	  IN	A	172.16.4.1
n1	  IN	A	172.16.4.1
www2	  IN	A	172.16.4.2

sudo gedit rev.4.16.172.in-addr.arpa

$TTL	604800
@	IN	SOA	n1.tugab.bg. admin.tugab.bg. (
			      1		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
	IN	NS	tugab.bg.
1	IN	PTR	tugab.bg.
  • sudo /etc/init.d/bind9 restart
  • sudo vi /etc/resolv.conf
  • dig tugab.com /
  • nslookup 172.16.0.1